ActionForm requirement

Discussions

Web tier: servlets, JSP, Web frameworks: ActionForm requirement

  1. ActionForm requirement (1 messages)

    I would like to know if having an ActionForm is necessary for each form.
    I have a page which has a Logout button. When I click on it I get an error message saying "javax.servlet.ServletException: Cannot retrieve definition for form bean null".

    Here's the snippet from struts-config.xml :
     <action path="/logout"
               type="com.labs.argenerator.LogoutAction">
            <forward name="success" path="/Login.jsp"/>
     </action>

    Here's the snippet from the jsp page:
    <html:form action="logout.do">
    <html:submit><bean:message key="button.exit"/></html:submit>
    </html:form>

    Can someone tell me what is wrong here?
  2. Re: ActionForm requirement[ Go to top ]

    I would like to know if having an ActionForm is necessary for each form.
    No, it is not.
    Here's the snippet from struts-config.xml : <action path="/logout" type="com.labs.argenerator.LogoutAction"> <forward name="success" path="/Login.jsp"/> </action>Here's the snippet from the jsp page:<html:form action="logout.do"><html:submit><bean:message key="button.exit"/></html:submit></html:form>Can someone tell me what is wrong here?
    <html:form/> tag needs a form, so to get rid of error you should:

    1) not use this tag, instread use plain HTML <form> tag,
    2) add empty, dummy dynaForm and assign it to the action using "name" attribute,
    3) not use HTML form at all, but rather <html:link/>.

    --
    Piotr Maj