转发:地址不改变,是一个请求 默认为转发 将redirect设置为true就变为重定向
重定向:地址改变了
<forward name=”login” path=”/login.jsp” redirect=”true”/>
设置全局的forward
<global-forwards>
<forward name="login" path="/login.jsp" redirect="true"/>
</global-forwards>
Struts配置文件运行期不允许修改
Struts的转发:return mapping.findForward(“login”);
自己的转发:respones.sendRedirect(request.getContextPath()+“/login.jsp”) ; 需要return null;
动态ActionForward
ActionForward af=new ActionForward();
af.setPath(“login”+page+”.jsp”);
ActionForward的属性:path,className,