struts form bean

D

Daniel Wang

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.
 
T

Tim Slattery

Daniel Wang said:
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/userGuide/struts-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/userGuide/struts-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/bayern/bayern_apxA.pdf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,044
Latest member
RonaldNen

Latest Threads

Top