Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Struts:FormBean issue with html:select tag

    I have a JSP that has the following code:
    <html:select name="formBean" property="textId">
    <html: options
    collection="WORDS"
    property="txtBody"
    labelProperty="txtName"
    <html: options
    </html:select>

    I have the setters and getters for the bean attributes in the form bean that is defined in the struts-config.xml file as:
    <form-beans>
    <form-bean name="formBean" type="com.xora.apps.messaging.presentation.form.MyForm
    </form-beans>

    The collection WORDS is set in the request attribute and contains a List of values when the action form is called(ie when the form loads) to be populated in the options tag. But when the form loads the message:

    500 Servlet Exception
    javax.servlet.jsp.JspException: Cannot find bean under name formBean

    is displayed even after manually creating the formBean instance in the ActionForm page as
    MyForm formBean = new MyForm();

    Any fix suggested would be greatly appreciated...

  • #2
    New Coder
    Join Date
    Apr 2004
    Location
    Texas
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    don't know much about javabeans, but...you didn't close your quotation mark for type if that matters...I would think it might.

    <form-bean name="formBean" type="com.xora.apps.messaging.presentation.form.MyForm
    Jason B

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Nor is there a closing '>'.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •