Struts 2 URL错误
这是我的 struts 配置文件
: 我的项目的根目录是StrutsProject。
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="false" />
<package name="first" namespace="/helloworld" extends="struts-default">
<action name="HelloWorld" class="com.abc.actions.HelloWorldAction">
<result name="SUCCESS">/pages/login.jsp</result>
</action>
</package>
</struts>
我正在尝试访问以下网址: http://localhost:8080/StrutsProject/helloworld/HelloWorld.action
我收到以下错误:
There is no Action mapped for action name helloworld. - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:497)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
请帮忙, 悉达多
This is my struts config file
:
The root of my project is StrutsProject.
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="false" />
<package name="first" namespace="/helloworld" extends="struts-default">
<action name="HelloWorld" class="com.abc.actions.HelloWorldAction">
<result name="SUCCESS">/pages/login.jsp</result>
</action>
</package>
</struts>
I am trying to access the following URL:http://localhost:8080/StrutsProject/helloworld/HelloWorld.action
I am getting the following error:
There is no Action mapped for action name helloworld. - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:497)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
Please help,
Siddharth
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的JSP文件位置是否正确?
或者应该是
Is your JSP file location is correct??
Or It should be