-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
externalisation des libelles dans un fichier properties et appel à ce…
…ux ci via @value
- Loading branch information
hvle
committed
Jun 20, 2014
1 parent
6309b0a
commit 15b2358
Showing
3 changed files
with
15 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,29 @@ | ||
package org.hvle.controller; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestMethod; | ||
import org.springframework.web.servlet.ModelAndView; | ||
|
||
@Controller | ||
public class HelloController { | ||
|
||
|
||
@Value("${title}") | ||
private String title; | ||
|
||
@Value("${message}") | ||
private String message; | ||
|
||
@RequestMapping(value = { "/" }, method = RequestMethod.GET) | ||
public ModelAndView welcomePage() { | ||
|
||
ModelAndView model = new ModelAndView(); | ||
model.addObject("title", "Spring Security Hello World"); | ||
model.addObject("message", "This is welcome page!"); | ||
model.addObject("title", this.title); | ||
model.addObject("message", this.message); | ||
model.setViewName("hello"); | ||
return model; | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
title=Spring Security Hello World | ||
message=This is welcome page! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters