Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > struts form bean

Reply
Thread Tools

struts form bean

 
 
Daniel Wang
Guest
Posts: n/a
 
      06-09-2004
How do I access the form bean in struts?

For example, the bean called formBean has a method called isError(String
param).

Suppose the user enters information in Form.jsp and gets redirected to the
action, and then because he missed some required fields, is sent back to
Form.jsp. How would I get the formBean, and how would I call the above
method?




Thanks.


 
Reply With Quote
 
 
 
 
Tim Slattery
Guest
Posts: n/a
 
      06-09-2004
"Daniel Wang" <> wrote:

>How do I access the form bean in struts?
>
>For example, the bean called formBean has a method called isError(String
>param).
>
>Suppose the user enters information in Form.jsp and gets redirected to the
>action, and then because he missed some required fields, is sent back to
>Form.jsp. How would I get the formBean, and how would I call the above
>method?


From your JSP page you use the Struts HTML tags. Look here:
http://jakarta.apache.org/struts/use...ruts-html.html

If you need to make a decision based on the isError property, you can
query it with the Struts Logic tags:
http://jakarta.apache.org/struts/use...uts-logic.html

But it's often easier to query bean properties and make decisions by
using the JSTL tags:
http://www.manning-source.com/books/...ayern_apxA.pdf

--
Tim Slattery

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
struts indexed form elements not getting into form bean apaeth@fortdearborn.com Java 1 01-07-2006 09:29 PM
Struts - bean:write or html:text - not getting bean value - Please help jill Java 5 12-15-2005 03:03 PM
Simple Struts question: how can I add the value of a bean variable to arg0 of the bean:message tag? Thomas P. Fuller Java 1 08-17-2004 01:42 AM
Populating the struts form bean through IE 5.5 Megha Vishwanath Java 1 07-18-2004 04:24 PM
struts: double processing after bean outputs form Ariel Jakobovits Java 3 09-26-2003 07:29 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57