tags:

views:

362

answers:

1

I've started an application using struts 2.0.14 and web server is apache tomcat 6.0. I am getting an error, please help me to solve this.

Application name: strutsTest

Welcome page: EmpDetails.jsp in a package named ‘validTest’ having action like:

<s:form action="takeAction" method="post>

Action class: Employee.java and also I wrote Employee-validation.xml.

Now when I run my application it opens with following url: http://localhost:8080/strutsTest/validTest/empDetails.jsp

There is only textbox in empDetails.jsp named email and I am validating this textbox using employee-validation.xml To test this I entered an invalid email and got an error message on the top of same welcome page (empDetails.jsp). But this url changed to: http://localhost:8080/strutsTest/validTest/takeAction.action

Not an issue. Now, I entered valid email and submit but got an error message instead of next page i.e thanks.jsp and url has changed to -

http://localhost:8080/strutsTest/takeAction.action

Error is:

HTTP Status 404 - /strutsTest/thanks.jsp

type Status report

message  /strutsTest/thanks.jsp

description The requested resource (/simpleStruts2.0.14/thanks.jsp) is not available.
+2  A: 

From your description, the validation part is excluded for your problem. In your struts.xml file, you may have configure the result as:

<action name="takeAction" ...>           
    <result>/simpleStruts2.0.14/thanks.jsp</result>
</action>

The result page: /simpleStruts2.0.14/thanks.jsp is not available(so HTTP 404 response), you may changed to something like this:

<result>/validTest/thanks.jsp</result>
jscoot