Struts2重定向后页面不跳转,求大神解决!

茂盛的小绿芽 2014-11-06 01:41:33
struts.xml action的配置
<action name="NewsAction_*" class="newsAction" method="{1}">
<result name="toNewsListPage">/back/news.jsp</result>
<result name="toAddNewsPage">/back/news_add.jsp</result>
<result name="toNewsListAction" type="redirectAction">NewsAction_findAll</result>
</action>


Action代码!是从下边的action中返回toNewsListAction ,转到NewsAction_findAll action中
/**
* 查询所有新闻方法
* @return
*/
public String addNewsEntity(){
newsService.addNewsEntity(model);
return "toNewsListAction";
}


从定向的action
	/**
* 查询所有新闻方法
* @return
*/
public String findAll(){
this.newsEntityList = newsService.findAllEntity();
System.out.println("findall");
return "toNewsListPage";
}

现在已经进入到重定向的action中了!但是不知为什么页面就是不跳转。
...全文
312 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Yaphets_VJ 2014-11-06
  • 打赏
  • 举报
回复
正解在这里 :<result name="toNewsListAction" type="redirect">NewsAction_findAll.action</result>
茂盛的小绿芽 2014-11-06
  • 打赏
  • 举报
回复
<action name="NewsAction_*" class="newsAction" method="{1}">
			<result name="toNewsListPage">/back/news.jsp</result>
			<result name="toAddNewsPage">/back/news_add.jsp</result>
			<result name="toNewsListAction" type="redirect">findAll.action</result>
		</action>
现在进不去转发的action了
HeiBoyYang 2014-11-06
  • 打赏
  • 举报
回复
<result name="toNewsListAction" type="redirectAction">NewsAction_findAll</result> 换成 <result name="toNewsListAction" type="redirect">findAll.action</result>

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧