zoukankan      html  css  js  c++  java
  • 五、指定多个配置文件

    四、指定多个配置文件

        1.src目录下新建hello.xml

    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd">
    <struts>
    
        <package name="default" namespace="/" extends="struts-default">
        
            <action name="helloworld_*" method="{1}" class="com.myz.action.HelloWorldAction">
                <result>/result.jsp</result>
                <result name="{1}">/{1}.jsp</result>
            </action>
    
        </package>
        
    </struts>    

        2.struts.xml中引入

    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd">
    <struts>
        <!-- 引入包下的xml
            <include file="com/myz/action/hello.xml"></include> 
            路径错误不会报错,会相当于没有引入
        -->
        <include file="hello.xml"></include>
    </struts>    
  • 相关阅读:
    CODEFORCES 429B 动态规划
    HDU 2084(DP)
    最大公约数算法(待续)
    spring---aop 配置
    代理模式
    spring--学习之IOC DI
    spring--基本介绍
    JAVASE 面试总结(1)
    工厂模式
    建造者模式
  • 原文地址:https://www.cnblogs.com/myz666/p/8454298.html
Copyright © 2011-2022 走看看