jsp:forward跳转到action

今天在用struts2中,想index.jsp中使用
<jsp:forward page="house/house!listhouse.action"></jsp:forward>
跳转到action中,测试不行,后来测试有2种比较好的方法:
第一种:在web.xml中配置
<filter-mapping>
		<filter-name>struts2</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
	</filter-mapping>
在该配置中可以有0-4个dispatcher,如果没有指定任何< dispatcher >元素,默认值是REQUEST,表示对客户请求启用过滤器FORWARD表示由一个forward调用分派来的请求启用过滤器
第二种:在meta中写
<meta http-equiv="Refresh" content="0;URL=house/house!listhouse.action"> 

当然还有在javascript中使用
window.location.href=<meta http-equiv="Refresh" content="0;URL=house/house!listhouse.action"> 
的方案

猜你喜欢

转载自dengry.iteye.com/blog/1946846
今日推荐