Created
December 5, 2010 04:36
-
-
Save lincolnthree/728801 to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html> | |
<head> | |
<title>Seam MVC</title> | |
</head> | |
<body> | |
<h1>Enter your name:</h1> | |
<form method="post"> | |
@include{html/checkbox ; name='foo' ; value='val' ; bind='indexBean.selected'; } | |
@include{html/inputText ; name='who' ; bind='indexBean.name' } | |
</form> | |
@if{indexBean.selected != empty} | |
Hello, @{indexBean.name == empty ? "Somebody" : indexBean.name}! | |
@end{} | |
</body> | |
</html> |
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
package org.jboss.seam.mvc.test; | |
import javax.enterprise.context.RequestScoped; | |
import javax.inject.Named; | |
@Named | |
@RequestScoped | |
public class IndexBean | |
{ | |
private String name; | |
private String selected; | |
public String getName() | |
{ | |
return name; | |
} | |
public void setName(final String name) | |
{ | |
System.out.println("Set name [" + name + "]"); | |
this.name = name; | |
} | |
public String getSelected() | |
{ | |
return selected; | |
} | |
public void setSelected(final String selected) | |
{ | |
System.out.println("Set selected [" + selected + "]"); | |
this.selected = selected; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment