日期:2014-05-17 浏览次数:20864 次
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd"> <struts> <package name="pengBBS" extends="struts-default"> <interceptors> <!--判断是否登录 和 是否有访问权限 <interceptor-ref name="token"></interceptor-ref>--> <interceptor name="login" class="pengbbs.controller.LoginInterceptor" /> <interceptor-stack name="myStack"> <interceptor-ref name="login"></interceptor-ref> <interceptor-ref name="defaultStack"></interceptor-ref> </interceptor-stack> </interceptors> <default-interceptor-ref name="myStack"></default-interceptor-ref> <!-- 全局拦截 --> <global-results> <!-- 拦截没登录返回结果,第一个是已经登录,不必重复登录 --> <result name="noLogin" type="redirect">/login.jsp</result> <!-- 拦截没有权限返回结果 --> <result name="noPower" type="redirect">/no_power.jsp</result> </global-results> </package> <constant name="struts.objectFactory" value="spring" /> <package name="main" extends="pengBBS"> <action name="login_*" class="loginAction" method="{1}"> <result name="error">/login.jsp</result> <result name="logout">/login.jsp</result> <result name="success" type="chain">post_getBoards</result> <interceptor-ref name="defaultStack"></interceptor-ref> </action> <action name="register_*" class="registerAction" method="{1}"> <result name="success" type="chain">post_getBoards</result> <result name="error">/error.jsp</result> <result name="input">/register.jsp</result> <interceptor-ref name="defaultStack"></interceptor-ref> </action> <action name="post_*" class="postAction" method="{1}"> <interceptor-ref name="defaultStack"></interceptor-ref> <result name="success">/post_view.jsp</result> <result name="topics">/post_view.jsp</result> <result name="board">/index.jsp</result> <result name="notPost">/error.jsp</result> <result name="view">/viewDetail.jsp</result> <result name="reply" type="chain">post_viewDetail</result> <result name="invalid.token">/error.jsp</result> </action> <action name="post" class="postAction"> <interceptor-ref name="defaultStack"></interceptor-ref> <interceptor-ref name="token"></intercepto