struts2为应用指定多个配置文件

来源:互联网 发布:飞天侠淘宝客9.0开源 编辑:程序博客网 时间:2024/04/28 19:09

struts.xml:

<?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><include file="struts-employee.xml"></include><include file="struts-manager.xml"></include></struts>

struts-employee.xml:

<?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><package name="employee" extends="struts-default" namespace="/control/employee"><action name="add" class="blog.action.HelloWorld" method="execute" ><result name="success">/WEB-INF/page/addEmployee.jsp</result></action></package></struts>

struts-manager.xml:

<?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><package name="manager" extends="struts-default" namespace="/control/manager"><action name="add" class="blog.action.HelloWorld" method="execute" ><result name="success">/WEB-INF/page/addManager.jsp</result></action></package></struts>



原创粉丝点击