html:form action=... - Newbie
Hi, Here's what I want to achieve : I have a form (call it INPUT). Let's say the form's action is ActionA.do. ActionA.do is mapped to com.mycompany.myclass, which can either forward to success or failure. In struts-config.xml, success is mapped to ActionB.do, and I want failure to be mapped to a simple JSP error page, call it failure.jsp. In other words, I don't want to re-display INPUT with errors (html:errors) : I want a completely different page, because it doesn't make sense in my application to re-display the INPUT form when this error occurs. In failure.jsp, I want to display the error message, and have a button that, when clicked, will return the user to some other page, mapped to ActionStart.do. So, I thought I would use the following struts tag : html:form action=ActionStart.do in that error page. When I try the application, and the failure condition is triggered, I get the following error message : 2004-12-03 13:27:20 StandardWrapperValve[action]: Servlet.service() for servlet action threw exception org.apache.jasper.JasperException: Cannot retrieve definition for form bean null at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 54) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) ... My fix for this error was to forget about the struts html:form... tag, and just use HTML's form... instead. Although this worked, I would love to have an explanation as to why I got the error mentionned, and maybe some workaround that would let me use html:form... --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.802 / Virus Database: 545 - Release Date: 11/26/2004 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:form action=... - Newbie
The reason is that in classical HTML; forms are expected to accept input. Struts stores the input data in an ActionForm; the traditional approach for what you are doing would be to use a link and not a button. -Bill Siggelkow Jacques wrote: Hi, Here's what I want to achieve : I have a form (call it INPUT). Let's say the form's action is ActionA.do. ActionA.do is mapped to com.mycompany.myclass, which can either forward to success or failure. In struts-config.xml, success is mapped to ActionB.do, and I want failure to be mapped to a simple JSP error page, call it failure.jsp. In other words, I don't want to re-display INPUT with errors (html:errors) : I want a completely different page, because it doesn't make sense in my application to re-display the INPUT form when this error occurs. In failure.jsp, I want to display the error message, and have a button that, when clicked, will return the user to some other page, mapped to ActionStart.do. So, I thought I would use the following struts tag : html:form action=ActionStart.do in that error page. When I try the application, and the failure condition is triggered, I get the following error message : 2004-12-03 13:27:20 StandardWrapperValve[action]: Servlet.service() for servlet action threw exception org.apache.jasper.JasperException: Cannot retrieve definition for form bean null at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 54) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) ... My fix for this error was to forget about the struts html:form... tag, and just use HTML's form... instead. Although this worked, I would love to have an explanation as to why I got the error mentionned, and maybe some workaround that would let me use html:form... --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.802 / Virus Database: 545 - Release Date: 11/26/2004 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:form action=... - Newbie
From: Jacques [EMAIL PROTECTED] When I try the application, and the failure condition is triggered, I get the following error message : 2004-12-03 13:27:20 StandardWrapperValve[action]: Servlet.service() for servlet action threw exception org.apache.jasper.JasperException: Cannot retrieve definition for form bean null Rather than make up names, it's a lot easier if you just use the real names of the forms and classes you're working on. That error means that Struts can't figure out what form bean you want it to use. You probably left out the name=formName attribute, probably in the action tag in struts-config.xml. Post your actual config information [just the action tag] and some of your JSP code, and someone will probably spot the error. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [BULK] - Re: html:form action=... - Newbie
-Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Friday, December 03, 2004 11:31 AM To: Struts Users Mailing List Subject: [BULK] - Re: html:form action=... - Newbie From: Jacques [EMAIL PROTECTED] When I try the application, and the failure condition is triggered, I get the following error message : 2004-12-03 13:27:20 StandardWrapperValve[action]: Servlet.service() for servlet action threw exception org.apache.jasper.JasperException: Cannot retrieve definition for form bean null Rather than make up names, it's a lot easier if you just use the real names of the forms and classes you're working on. That error means that Struts can't figure out what form bean you want it to use. You probably left out the name=formName attribute, probably in the action tag in struts-config.xml. Post your actual config information [just the action tag] and some of your JSP code, and someone will probably spot the error. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]