-
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.
Note that CSRF protection doesn't work yet, see mvc-spec/ozark#202
- Loading branch information
1 parent
8b5e1a8
commit f8900f5
Showing
4 changed files
with
73 additions
and
2 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
18 changes: 18 additions & 0 deletions
18
src/main/java/it/mulders/junk/mvc/presentation/UserPreferences.java
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,18 @@ | ||
package it.mulders.junk.mvc.presentation; | ||
|
||
import javax.enterprise.context.SessionScoped; | ||
import java.io.Serializable; | ||
import java.util.Locale; | ||
|
||
@SessionScoped | ||
public class UserPreferences implements Serializable { | ||
private Locale locale; | ||
|
||
public Locale getLocale() { | ||
return locale; | ||
} | ||
|
||
public void setLocale(Locale locale) { | ||
this.locale = locale; | ||
} | ||
} |
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
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,22 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>Hello MVC</title> | ||
</head> | ||
<body> | ||
<div> | ||
<form action="${pageContext.request.contextPath}/app/hello/configure" method="post"> | ||
<input type="hidden" name="${mvc.csrf.name}" value="${mvc.csrf.token}"/> | ||
<label for="locale">Select the language of your choice</label> | ||
<select id="locale" name="locale"> | ||
<option value="nl-NL">Dutch</option> | ||
<option value="de-DE">German</option> | ||
<option value="fr-FR">French</option> | ||
<option value="en-UK">English (UK)</option> | ||
<option value="en-US">English (US)</option> | ||
</select> | ||
<button type="submit">Submit</button> | ||
</form> | ||
</div> | ||
</body> | ||
</html> |