Looks like there is a functional change or bug in the action input attribute
in Struts 1.1 - a forward name must be used instead of the location of a JSP
or Action. Not sure why this change happened between 1.1RC and 1.1rel -
maybe someone on the Struts dev team can answer?

-----Original Message-----
From: Andy Kriger [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 27, 2004 2:46 PM
To: Struts Users Mailing List
Subject: form validation question

I am having a curious problem with form validation. I submit a form, see in
the logs that the form fails to validate, however, the webapp does not
return to the input page (I get a blank page with no HTML in it), so I do
not see the form with error messages as expected. If I put text in the
field, the form does submit correctly and I see the JSP specified in the
resulting action chain. The log files have no error messages indicating
something is amiss. When validation fails, the subsequent action is
definitely not running (I do not see the logging in the execute method).

Does anyone have any ideas what could be happening here? 
Or how I can track down the problem?
Below is the relevant info...

=== STRUTS CONFIG ===

<action path="/OrderForm" forward="/web/forms/orderForm.jsp" />
                
<action path="/SubmitOrder"             
         type="MyClass"
         name="orderForm" 
         validate="true" 
         input="/OrderForm.do"
         scope="request">
        <forward name="success" path="/OrderThanks.do"/> </action>
                
<action path="/OrderThanks" parameter="/web/orderThanks.jsp"
type="org.apache.struts.actions.ForwardAction"/>

=== orderForm.jsp ===
<logic:messagesPresent>
        <html:messages id="err">
                <%=err%><br/>
        </html:messages>
</logic:messagesPresent>

<html:form action="SubmitOrder.do">
        <html:text property="firstName" styleId="firstName" size="20"/>
        <html:submit value="Press Me"/>
</html:form>

=== VALIDATION CONFIG ===
<form name="orderForm">
        <field property="firstName" depends="required">
                <arg0 key="orderForm.firstName.label" name="required" />
        </field>
</form>

=== LOG MESSAGES ===
[org.apache.struts.action.RequestProcessor][RequestProcessor    ]
Validating input form properties
[org.apache.struts.action.RequestProcessor][RequestProcessor    ]
Validation failed, returning to '/OrderForm.do'



Andy Kriger | Software Mechanic | Greater Than One, Inc.
28 West 27th Street | 7th Floor | New York, NY 10001
P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED] 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to