struts2 跳转出错

J2EE 码拜 8年前 (2016-03-13) 1100次浏览
用户struts的action 控制页面跳转 ,以前都是好好的,可是最近一直出现一些问题,
例如以下代码,在action的类名前面加注解,原因是action和jsp的包名不一样,所以加上了注解跳转

@Results({@Result(name = "p_setting", location = "/setting/p_setting.jsp"),
    @Result(name = "b-setting", location = "/setting/b_setting.jsp"),
    @Result(name = "a-setting", location = "/setting/a_setting.jsp")})

就这里 ,最近有时会直接跳转到首页,程序在tomcat中,重新启动后,好了,可是别的跳转又到了首页(代码一模一样的写法),
并且随着程序运行时间的加长,跳转到首页的link越来越多。
跳转到首页,本人在struts.xml中有这些配置

        <global-exception-mappings>
		<exception-mapping exception="java.lang.Exception" result="index" /> 
	</global-exception-mappings>

但是后台日志里面都没见过报错信息

解决方案

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明struts2 跳转出错
喜欢 (0)
[1034331897@qq.com]
分享 (0)