Results 1 to 1 of 1
Thread: Bean related actions in JSP
-
Bean related actions in JSP
Following example shows how to use Bean related actions in a JSP page.
Java Code:<HTML> <jsp:declaration> //thisisalocal"helper"beanforprocessingtheHTMLform static public class localBean { private String value; public String getValue(){return value;} public void setValue(String s){value=s;} } </jsp:declaration> <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"/> </jsp:useBean> <%--Whatever HTTP parameters we have, try to set ananalogous bean property--%> <jsp:setProperty name="localBean" property="*"/> <HEAD><TITLE>Hello World w/ JavaBean</TITLE></HEAD> <BODY> <CENTER> <P><H1>Hello <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'/>"> <BR> <INPUT TYPE="submit" VALUE="Submit"> </FORM> </CENTER> </BODY> </HTML>
Similar Threads
-
Help using Buttons/Actions with Drawings
By Deathmonger in forum New To JavaReplies: 0Last Post: 04-08-2008, 03:11 PM -
How to use Inner bean definitions via nested bean elements
By Java Tip in forum Java TipReplies: 0Last Post: 03-30-2008, 10:03 AM -
Actions
By alley in forum AWT / SwingReplies: 2Last Post: 01-16-2008, 02:52 PM -
How to use Inner bean definitions via nested bean elements
By JavaBean in forum Java TipReplies: 0Last Post: 09-26-2007, 08:36 PM -
Maximum size permited in the parameters in actions and servlets
By Eric in forum Java ServletReplies: 2Last Post: 07-03-2007, 04:09 PM
Bookmarks