Struts / Validator PlugIn Problem

Hello,

I am building a small LoginForm with the Validator PlugIn ( struts 1.3.8 - tomcat 5.0).

The Problem is:

The first page validates perfectly. I get the proper error-messages and the right forwarding.

But the second page is trouble:

Its displayed correctly, but if I push the login button it kicks me back to page one... regardless if the input was correct or not..

Ive build page2 according to page1... but it seems I screwed sth up and I cant find it...

here ist my struts-config:

<struts-config>

<form-beans>

<form-bean name="orderFormBean"

type="coreservlets.OrderFormBean"/>

<form-bean name="orderFormBean2"

type="coreservlets.OrderFormBean2"/>

</form-beans>

<action-mappings>

<action path="/actions/order"

type="coreservlets.Order"

name="orderFormBean"

scope="request"

input="/forms/order-form.jsp">

<forward name="success"

path="/forms/order-form2.jsp"/>

</action>

<action path="/actions/order2"

type="coreservlets.Order2"

name="orderFormBean2"

scope="request"

input="/forms/order-form2.jsp">

<forward name="success2"

path="/WEB-INF/results/order-confirmation.jsp"/>

</action>

</action-mappings>

<message-resources parameter="MessageResources"/>

<plug-in className="org.apache.struts.validator.ValidatorPlugIn">

<set-property

property="pathnames"

value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>

</plug-in>

</struts-config>

if u want me to post more of the code. please tell me.

thanks guys

[2297 byte] By [nomaxa] at [2007-11-27 11:39:30]
# 1

hi

<forward name="success2"

path="/WEB-INF/results/order-confirmation.jsp"/>

</action>

already you close /> in the above line , then why you giving another </action> unnecessary ,

post your servlet action code

drvijayy2k2a at 2007-7-29 17:26:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

<forward name="success2"

path="/WEB-INF/results/order-confirmation.jsp"/>

</action>

the first "/>" tag is closing the "forward" - I guess....

correct me if I`m wrong

package coreservlets;

import javax.servlet.http.*;

import org.apache.struts.action.*;

public class Order extends Action {

public ActionForward execute(ActionMapping mapping,

ActionForm form,

HttpServletRequest request,

HttpServletResponse response)

throws Exception {

return(mapping.findForward("success"));

}

}

and accoding to that "Order2" with "success2"

Message was edited by:

nomax

nomaxa at 2007-7-29 17:26:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Have a look in your JSPs (assuming you are using them) and verify that you have the correct action mappings for each of your forms. Perhaps the second form is pointing back to the first action. Maybe post your JSPs.

Cheers, Kenny

krodmana at 2007-7-29 17:26:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

thanks Kenny! U got it right.

I forgot to change the action path in my new JSP File. It works just fine now

nomaxa at 2007-7-29 17:26:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

Sorry guys, Thats my mistake, wrongly mention,

drvijayy2k2a at 2007-7-29 17:26:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...