struts form bean

Discussion in 'Java' started by Daniel Wang, Jun 9, 2004.

  1. Daniel Wang

    Daniel Wang Guest

    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.
     
    Daniel Wang, Jun 9, 2004
    #1
    1. Advertising

  2. Daniel Wang

    Tim Slattery Guest

    "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/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

    --
    Tim Slattery
     
    Tim Slattery, Jun 9, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ariel Jakobovits
    Replies:
    3
    Views:
    606
    Ariel Jakobovits
    Sep 26, 2003
  2. Megha Vishwanath
    Replies:
    1
    Views:
    505
    Murray
    Jul 18, 2004
  3. Thomas P. Fuller
    Replies:
    1
    Views:
    4,576
    bitbucket43
    Aug 17, 2004
  4. jill
    Replies:
    5
    Views:
    15,713
  5. Replies:
    1
    Views:
    3,920
    Tim B
    Jan 7, 2006
Loading...

Share This Page