1.先是判断后台传递的html是否为空
<c:if test="${empty html}" >
<jsp:forward page="smartdemo/controltable.action" />
</c:if>
2.如果为空就跳转,在servlet中直接跳转就可以,但是struts2中会包路径错误,更改为正确路径也会报错 如:../../../smartdemo/controltable.action
在web.xml中配置过滤器实例如下
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
方法二:可以在js中判断直接跳转,不用修改过滤器
方法三:是看见其他大神的跳转方式,没试过:
<meta http-equiv="refresh" content="0;URL=xxx.action">