struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djia002 <dongmingji...@hotmail.com>
Subject Struts2 Validation
Date Fri, 25 Jan 2008 01:13:56 GMT

Hello , I am new to struts2. Please help me on this problem.

I have a configuration like this 
        <action name="Action1.*" method="{1}" class="ActionClass1">
            <result name="summary">/page1.jsp</result>
            <result name="detail">/page2.jsp</result>
        </action>

        <action name="Action2.*" method="{1}" class="ActionClass2">
            <result name="summary">/page1.jsp</result>
            <result name="detail">/page2.jsp</result>
            <result name="input">/page2.jsp</result>
        </action>


The flow is I submit a form from page1 to Action ActionClass2.edit method, 

public String edit() throws Exception {

// fetch some data and push into session for rendering page2.jsp ...


return "detail"; // This will forward to page2.jsp
}

You can see from the code that edit() method try to store some data in
session for displaying page2.jsp.

Everything works fine until i added ActionClass2-validation.xml for
validating the form on page2.jsp.

I got error says "No result defined for action  and result input."
so I added <result name="input">page2.jsp</result> into configuration. and
then of course it just simply try to display page2.jsp without having data
preloaded by edit() because edit() not get called at all.

How can I work around with this problem?

Thanks in advance.
Kevin
-- 
View this message in context: http://www.nabble.com/Struts2-Validation-tp15079124p15079124.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message