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?
-
ActionForm requirement (1 messages)
- Posted by: Poorav Sheth
- Posted on: July 20 2004 18:39 EDT
Threaded Messages (1)
- Re: ActionForm requirement by Piotr Maj on July 21 2004 02:41 EDT
-
Re: ActionForm requirement[ Go to top ]
- Posted by: Piotr Maj
- Posted on: July 21 2004 02:41 EDT
- in response to Poorav Sheth
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