Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-24-2007, 11:04 AM
Moderator
 
Join Date: Nov 2007
Posts: 1,657
Java Tip will become famous soon enoughJava Tip will become famous soon enough
Bean related actions in JSP
Following example shows how to use Bean related actions in a JSP page.

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>
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help using Buttons/Actions with Drawings Deathmonger New To Java 0 04-08-2008 04:11 PM
How to use Inner bean definitions via nested bean elements Java Tip Java Tips 0 03-30-2008 11:03 AM
Actions alley AWT / Swing 2 01-16-2008 03:52 PM
How to use Inner bean definitions via nested bean elements JavaBean Java Tips 0 09-26-2007 09:36 PM
Maximum size permited in the parameters in actions and servlets Eric Java Servlet 2 07-03-2007 05:09 PM


All times are GMT +3. The time now is 03:27 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org