<package name="login" namespace="/" extends="struts-default">
<action name="loginAction" class="com.trojan.lebronye.action.LoginAction">
<result name="login1">/foreground/index.jsp</result>
<result name="login2">/background/index.jsp</result>
<result name="loginfail">/loginfail.jsp</result>
<result name="error">/error.jsp</result>
</action>
</package>我的登录页面和foreground,background文件夹在同一个页面下~~我的struts2配置怎么写才能跳转到foreground或background下的另一个页面呢?
<action name="loginAction" class="com.trojan.lebronye.action.LoginAction">
<result name="login1">/foreground/index.jsp</result>
<result name="login2">/background/index.jsp</result>
<result name="loginfail">/loginfail.jsp</result>
<result name="error">/error.jsp</result>
</action>
</package>我的登录页面和foreground,background文件夹在同一个页面下~~我的struts2配置怎么写才能跳转到foreground或background下的另一个页面呢?
你文件夹foreground如果在webRoot下/foreground/index.jsp
如果不是/***/.../foreground/index.jsp这样写不行吗
<result name="login1">./foreground/index.jsp</result>
<result name="login2">background/index.jsp</result>试试这个
你可以在业务逻辑里面写啊 execute方法里面
关注Java
return "login1";
<result name="success" type="redirect">/foreground.jsp</result>
</action>在jsp页面中只要把路径写对就可以了<s:form action="foreground">
......
</s:form>