Any suggestions???? 

-----Original Message-----
From: Phan, Hienthuc T 
Sent: Friday, May 16, 2008 6:41 PM
To: Struts Users Mailing List
Subject: Struts 2: After validation fail, how to change the returning
result name to other than INPUT?

Hi,

I have a CustomerAction class.  In CustomerAction, I have two methods:
add and update.  I have a CustomerAction-validation.xml to check for
required fields, etc.  My struts.xml looks something like this:

        <package name="customer">
                <action name="customer_*"
class="com.action.CustomerAction" method="{1}">
                        <result
name="create">/customer_create.jsp</result>
                        <result
name="update">/customer_update.jsp</result>
                </action>
        </package>

When the validation fail, I would like it to return to the previous page
(either cusomer_create.jsp or customer_update.jsp).  However, Struts
returns result = "input" automatically when the validation fail. How do
I change the result from "input" to either "add" or "update"?

A clunky way to solve this problem is to create two actions.  That would
generate too many classes.  Is there a good solution for this problem of
mine?  Thanks.

-Hien
Notice:  This e-mail message, together with any attachments, contains 
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New 
Jersey, USA 08889), and/or its affiliates (which may be known outside the 
United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as 
Banyu - direct contact information for affiliates is available at 
http://www.merck.com/contact/contacts.html) that may be confidential, 
proprietary copyrighted and/or legally privileged. It is intended solely for 
the use of the individual or entity named on this message. If you are not the 
intended recipient, and have received this message in error, please notify us 
immediately by reply e-mail and then delete it from your system.


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

Reply via email to