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]



Reply via email to