您的位置:首页 > 编程语言 > Java开发

struts2 配置文件

2016-01-19 09:54 471 查看
<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE struts PUBLIC

"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"

"http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>

<!-- 配置为开发模式 -->

<constant name="struts.devMode" value="true" />

<!-- 把扩展名配置为action -->

<constant name="struts.action.extension" value="action" />

<!-- 把主题配置为simple -->

<constant name="struts.ui.theme" value="simple" />

<package name="oa" namespace="/" extends="struts-default">

<interceptors>

<interceptor name="PrivilegeInterceptor" class="com.dfqf.oa.utils.PrivilegeInterceptor"></interceptor>

<interceptor-stack name="defaultStack">

<interceptor-ref name="PrivilegeInterceptor"/>

<interceptor-ref name="defaultStack"/>

</interceptor-stack>

</interceptors>

<global-results>

<result name="loginUI">/WEB-INF/jsp/userAction/loginUI.jsp</result>

<result name="logout">/WEB-INF/jsp/userAction/logout.jsp</result>

<result name="noPrivilege">/noPrivilegeError.jsp</result>

</global-results>

<action name="test" class="testAction">

<result name="success">/test.jsp</result>

</action>

<!-- 配置测试用的Action,未与Spring整合,class属性写类的全名 -->

<!-- 当Struts2与Spring整合后,class属性可以写bean的名称 -->

<action name="role_*" class="roleAction" method="{1}">

<result name="list">/WEB-INF/jsp/roleAction/role_list.jsp</result>

<result name="saveUI">/WEB-INF/jsp/roleAction/role_saveUI.jsp</result>

<result name="tolist" type="redirectAction">role_list</result>

<result name="setPrivilegeUI">/WEB-INF/jsp/roleAction/setPrivilegeUI.jsp

</result>

</action>

<action name="department_*" class="departmentAction" method="{1}">

<result name="list">/WEB-INF/jsp/departmentAction/department_list.jsp

</result>

<result name="saveUI">/WEB-INF/jsp/departmentAction/department_saveUI.jsp

</result>

<result name="tolist" type="redirectAction">department_list?parentId=${parentId}

</result>

</action>

<action name="user_*" class="userAction" method="{1}">

<result name="list">/WEB-INF/jsp/userAction/list.jsp</result>

<result name="saveUI">/WEB-INF/jsp/userAction/saveUI.jsp</result>

<result name="tolist" type="redirectAction">user_list</result>

<result name="index" type="redirectAction">home_index</result>

</action>

<action name="home_*" class="homeAction" method="{1}">

<result name="toindex">/WEB-INF/jsp/homeAction/index.jsp</result>

<result name="toright">/WEB-INF/jsp/homeAction/right.jsp</result>

<result name="toleft">/WEB-INF/jsp/homeAction/left.jsp</result>

<result name="totop">/WEB-INF/jsp/homeAction/top.jsp</result>

<result name="tobottom">/WEB-INF/jsp/homeAction/bottom.jsp</result>

</action>

<action name="forumManage_*" class="forumManageAction" method="{1}">

<result name="list">/WEB-INF/jsp/forumManageAction/list.jsp</result>

<result name="saveUI">/WEB-INF/jsp/forumManageAction/saveUI.jsp</result>

<result name="tolist" type="redirectAction">forumManage_list</result>

<result name="moveDown" type="redirectAction">forumManage_list</result>

<result name="moveUp" type="redirectAction">forumManage_list</result>

</action>

<action name="forum_*" class="forumAction" method="{1}">

<result name="list">/WEB-INF/jsp/forumAction/list.jsp</result>

<result name="show">/WEB-INF/jsp/forumAction/show.jsp</result>

</action>

<action name="topic_*" class="topicAction" method="{1}">

<result name="addUI">/WEB-INF/jsp/topicAction/addUI.jsp</result>

<result name="show">/WEB-INF/jsp/topicAction/show.jsp</result>

<result name="toshow" type="redirectAction">forum_show?forumId=${forumId}</result>

</action>

<action name="reply_*" class="replyAction" method="{1}">

<result name="addUI">/WEB-INF/jsp/replyAction/addUI.jsp</result>

<result name="toshow" type="redirectAction">topic_show?id=${topicId}</result>

</action>

</package>

<!-- Add packages here -->

</struts>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: