strust.xml内容如下:
<?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>
<package name="default" namespace="/" extends="struts-default">
<action name="hello">
<result >
/Hello.jsp
</result>
</action>
</package></struts>
(注:Hello.jsp的功能就是在页面显示:“Hello Struts2”)
我启动tomcat,在项目上Run as→MyEclipse Server Application,在Web Browser中成功显示“Hello Struts2”。然后我修改strust.xml文件:
①<action name="hello_struts">,
②加入<constant name="struts.devMode" value="true" />这一行再在Servers中Redeploy该项目,再在Web Browser中输入http://localhost:8080/Struts2_0100/hello_struts
就显示不出来“Hello Struts2”了错误: There is no Action mapped for namespace / and action name hello_struts.多次Redeploy项目都不行,这是为什么??
求助!
<?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>
<package name="default" namespace="/" extends="struts-default">
<action name="hello">
<result >
/Hello.jsp
</result>
</action>
</package></struts>
(注:Hello.jsp的功能就是在页面显示:“Hello Struts2”)
我启动tomcat,在项目上Run as→MyEclipse Server Application,在Web Browser中成功显示“Hello Struts2”。然后我修改strust.xml文件:
①<action name="hello_struts">,
②加入<constant name="struts.devMode" value="true" />这一行再在Servers中Redeploy该项目,再在Web Browser中输入http://localhost:8080/Struts2_0100/hello_struts
就显示不出来“Hello Struts2”了错误: There is no Action mapped for namespace / and action name hello_struts.多次Redeploy项目都不行,这是为什么??
求助!
命名空间 namespace="/" 访问的时候加后缀。楼主自己谷歌 struts namespace把
http://localhost:8080/Struts2_0100/hello_struts.action
为什么我之后就跳转不到Hello.jsp文件了?