求助一个struts2跳转问题
自己搭了个SSh框架。在地址栏输入http://localhost:7080/mobilBuyTicket/twe/mobilBooking!test.action测试数据测持久化。打断点能访问到test方法。但是无法跳转到result页面
web.xml中
<!-- Struts2拦截器 -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
<init-param>
<param-name>actionPackages</param-name>
<param-value>main.action</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
struts.xml中:
<action name="input" class="OutputAction" method="actionMethod">
<result name="output">/success.jsp</result>
</action>
action中方法
public String test(){
//this.mobilBookingService.creat();
return "out";
}
我把业务代码都注释掉了,就一个跳转,就跳不过去。提示
No result defined for action main.action.MobilBookingAction and result out
我把斜杠去掉<result name="output">success.jsp</result>还是报错,变为<result name="out" type="redirect">/success.jsp</result>也报错,我的success.jsp页面就是建在webRoot下的
请问是什么问题啊
web.xml中
<!-- Struts2拦截器 -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
<init-param>
<param-name>actionPackages</param-name>
<param-value>main.action</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
struts.xml中:
<action name="input" class="OutputAction" method="actionMethod">
<result name="output">/success.jsp</result>
</action>
action中方法
public String test(){
//this.mobilBookingService.creat();
return "out";
}
我把业务代码都注释掉了,就一个跳转,就跳不过去。提示
No result defined for action main.action.MobilBookingAction and result out
我把斜杠去掉<result name="output">success.jsp</result>还是报错,变为<result name="out" type="redirect">/success.jsp</result>也报错,我的success.jsp页面就是建在webRoot下的
请问是什么问题啊
...全文
相关推荐
struts2 中路径无法跳转的问题
NULL 博文链接:https://lishouxinghome.iteye.com/blog/1364946
Struts2从一个带参数action跳转到另一个action
资源中示例了一个struts2的配置文件中配置的action的result结果为另外一个action的配置,该跳转的过程中是带所有参赛调整的,在另外一个action中可以接受到当前action的所有参数,此配置文件是我日常开发中的经验总结,欢迎各位技术人员下载参考使用
Struts2简单的页面跳转示例
初学Struts2,写了一个简单的用struts2实现页面跳转的功能。高手勿喷
java Struts2 在拦截器里的跳转问题
前几天,自已写了一个拦截器,当在里面跳转时,报了一个如下异常,但页面能正常跳转
struts2 action跳转调用另一个程序
目的:主要为了在一个Action成功后跳转调用另一个程序。 Struts2.xml [html] 代码如下: <?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> <!– 指定为开发模式(默认值为false) –> <constant name=”struts.devMode”


Web 开发
