Skip to content

Instantly share code, notes, and snippets.

@lincolnthree
Created December 5, 2010 04:36
Show Gist options
  • Save lincolnthree/728801 to your computer and use it in GitHub Desktop.
Save lincolnthree/728801 to your computer and use it in GitHub Desktop.
<!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>
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