首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

struts2 在页面自动跳转到一个action,该怎么解决

2012-01-12 
struts2 在页面自动跳转到一个action错误:Struts has detected an unhandled exception:Messages: com.mei

struts2 在页面自动跳转到一个action
错误:
Struts has detected an unhandled exception: 

Messages: com.meishi.action.indexAction 
Unable to instantiate Action, com.meishi.action.indexAction, defined for 'index' in namespace '/back'com.meishi.action.indexAction 





页面:
<SCRIPT type="text/javascript">
setTimeout("loady()", 3000);
function loady(){
window.location='index.action';
}
</SCRIPT>

 </head>
  
  <body>
  成功登陆!!3秒后为你自动跳转<br/>
  如果页面没有自动加载,请
  <a href="index.action">单击这里</a>
  </body>


问题是:登录成功后,也跳转到了这个页面,3秒后跳转时出错了。
主要是地址栏多了一个namespace:
http://localhost:8080/meishi_final/back/index.action

正确地址应该是
http://localhost:8080/meishi_final/index.action


[解决办法]
window.location='../index.action';

热点排行