struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tglenister <>
Subject Bizarre validation issue
Date Sat, 08 Sep 2007 04:50:59 GMT

I am using Struts 2.06 and am seeing a bizarre issue - 

One of my Actions is validating fine - if the page is posted without
required data/formats the page is returned with error messages and all the
fields are still filled in.  We'll refer to this as action 1.
Another action (action 2) throws validation errors even if all the
requirements are met, and the page is returned with the fields cleared.  I
went round and round trying to isolate the issue, and found something
strange.  I copied the validation XML from action 1 into  action 2's file. 
I copied the JSP code from the input for action 1 to action 2, so now we
have validation xml and JSP code that is identical.  The action declarations
in struts.xml are virtually identical (I changed the Contact results from
contact.jsp to register.jsp for consistency.)  

<action name="doregister" class="com.mbg.actions.Register">
	<result name="input">register.jsp</result>
	<result name="error">register.jsp</result>
<action name="contact" class="com.mbg.actions.Contact">
        <result name="error">register.jsp</result>
	<result name="input">register.jsp</result>

When I call the doregister action from either the register.jsp or
contact.jsp pages (which are identical), no problem - the validation occurs
as expected and the page is returned with data filled in.  When I call
contact from either page, the validation fails (no matter what the input)
and the fields are cleared out.  Basically it likes the doregister action
but doesn't like the contact action.   Does anyone have a clue what's going
on or where I should look?  I'm at the end of my rope and am about to throw
out the validation altogether.  Thanks in advance.

View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message