struts2运行中的问题
我已经使用struts 2.0.14启动了一个应用程序,Web服务器是apache tomcat 6.0。 我收到错误,请帮我解决这个问题。
应用程序名称:strutsTest
欢迎页面:EmpDetails.jsp,位于名为“validTest”的包中,具有如下操作:
<s:form action="takeAction" method="post>
操作类:Employee.java 以及我编写了 Employee-validation.xml。
现在,当我运行我的应用程序时,它会打开以下网址: http://localhost:8080/strutsTest/validTest/empDetails.jsp
empDetails.jsp 中只有名为 email 的文本框,我正在验证此文本框使用员工验证.xml 为了测试这一点,我输入了无效的电子邮件,并在同一欢迎页面 (empDetails.jsp) 的顶部收到一条错误消息。 但这个网址改为: http://localhost:8080/strutsTest/validTest/takeAction.action
不是问题。 现在,我输入了有效的电子邮件并提交,但收到了一条错误消息,而不是下一页,即Thanks.jsp,并且 url 已更改为 -
http://localhost:8080/strutsTest/takeAction.action
错误是:
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.
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从您的描述来看,您的问题已排除验证部分。 在你的 struts.xml 文件中,你可能将结果配置为:
结果页面:/simpleStruts2.0.14/thanks.jsp 不可用(因此 HTTP 404 响应),你可以更改为如下所示:
From your description, the validation part is excluded for your problem. In your struts.xml file, you may have configure the result as:
The result page: /simpleStruts2.0.14/thanks.jsp is not available(so HTTP 404 response), you may changed to something like this: