struts1.x 分模块,安排struts-config.xml. 在web.xml中的配置


<?xml version="1.0" encoding="iso-8859-1"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at
   
         http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<!DOCTYPE web-app PUBLIC
        "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
    <display-name>Struts Examples Application</display-name>
    <!-- Standard Action Servlet Configuration (with debugging) -->
    <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>

        <!-- Default -->
        <init-param>
            <param-name>config</param-name>
            <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-param>

        <!-- Exercise module -->
        <init-param>
            <param-name>config/exercise</param-name>
            <param-value>/WEB-INF/exercise/struts-config.xml</param-value>
        </init-param>

        <!-- File Upload module -->
        <init-param>
            <param-name>config/upload</param-name>
            <param-value>/WEB-INF/upload/struts-config.xml</param-value>
        </init-param>

        <!-- Validator module -->
        <init-param>
            <param-name>config/validator</param-name>
            <param-value>/WEB-INF/validator/struts-config.xml,
                /WEB-INF/validator/struts-config-bundles.xml,
                /WEB-INF/validator/struts-config-i18nVariables.xml,
                /WEB-INF/validator/struts-config-type.xml,
                /WEB-INF/validator/struts-config-validwhen.xml
            </param-value>
        </init-param>

        <!-- Dispatch Action module -->
        <init-param>
            <param-name>config/dispatch</param-name>
            <param-value>/WEB-INF/dispatch/struts-config.xml</param-value>
        </init-param>

        <init-param>
            <param-name>debug</param-name>
            <param-value>2</param-value>
        </init-param>
        <init-param>
            <param-name>detail</param-name>
            <param-value>2</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>

    <!-- Standard Action Servlet Mapping -->
    <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>

    <!-- The Usual Welcome File List -->
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.html</welcome-file>
        <welcome-file>upload.jsp</welcome-file>
    </welcome-file-list>

</web-app>

你可能感兴趣的:(apache,xml,Web,jsp,struts)