Following example shows how to use Bean related actions in a JSP page.

Java Code:
static public class localBean
private String value;
public String getValue(){return value;}
public void setValue(String s){value=s;}
<jsp:useBean id="localBean" scope="page" class="localBean">
<%--Every time we create the bean, initialize the string--%>
<jsp:setProperty name="localBean" property="value" value="World"/>
<%--Whatever HTTP parameters we have,
try to set ananalogous bean property--%>
<jsp:setProperty name="localBean" property="*"/>
<HEAD><TITLE>Hello World w/ JavaBean</TITLE></HEAD>
<jsp:getProperty name='localBean' property='value'/></H1></P>
<FORM method=post>
Enter a name to be greeted:
<INPUT TYPE="text" SIZE="32" NAME="value"
VALUE="<jsp:getProperty name='localBean' property='value'/>">
<INPUT TYPE="submit" VALUE="Submit">