将Tiles插入现有Web项目

时间:2016-07-05 09:50:56

标签: java tiles struts-1

我在java web项目中工作,它使用struts 1.3。该项目有前端和后端,后端已经建成。现在我想用Tiles开发前端,所以我必须在web.xml中配置tiles.xml,但是struts-config.xlm已经在web.xml中配置了。我可以同时使用两个xml文件(struts-config.xlm,tiles.xml)进行映射过程,还是有办法做到这一点?

这是web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>

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

<web-app>


  <!-- Standard Action Servlet Configuration (with debugging) -->
  <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/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>


  <servlet>
        <servlet-name>dwr-invoker</servlet-name>
        <display-name>DWR Servlet</display-name>
        <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>true</param-value>
        </init-param>
    </servlet> 


    <servlet>
      <servlet-name>ServletConfiguratorSLT</servlet-name>
      <servlet-class>org.logicalcobwebs.proxool.configuration.ServletConfigurator</servlet-class>
      <init-param>
        <param-name>propertyFile</param-name>
        <param-value>WEB-INF/classes/resources/ProxoolSLT.properties</param-value>
      </init-param>
      <load-on-startup>1</load-on-startup>
    </servlet> 

    <servlet>
      <servlet-name>ServletConfiguratorCICOSE</servlet-name>
      <servlet-class>org.logicalcobwebs.proxool.configuration.ServletConfigurator</servlet-class>
      <init-param>
        <param-name>propertyFile</param-name>
        <param-value>WEB-INF/classes/resources/ProxoolCICOS.properties</param-value>
      </init-param>
      <load-on-startup>1</load-on-startup>
    </servlet> 

  <servlet>
  <servlet-name>proxool</servlet-name>
  <servlet-class>org.logicalcobwebs.proxool.admin.servlet.AdminServlet</servlet-class>
  </servlet>

    <servlet-mapping>
        <servlet-name>DownloadServlet</servlet-name>
        <url-pattern>/servlet/DownloadServlet</url-pattern>
    </servlet-mapping>


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

    <servlet-mapping>
        <servlet-name>dwr-invoker</servlet-name>
        <url-pattern>/dwr/*</url-pattern>
    </servlet-mapping>

  <servlet-mapping>
    <servlet-name>proxool</servlet-name>
    <url-pattern>/servlet/admin</url-pattern>
  </servlet-mapping>


  <!-- Session time out -->
  <session-config>
    <session-timeout>120</session-timeout>
  </session-config>


  <!-- The Usual Welcome File List -->
  <welcome-file-list>
    <welcome-file>public_dashboard.jsp</welcome-file>
    <welcome-file>login.jsp</welcome-file>
  </welcome-file-list>


  <!-- Error page specification -->
  <error-page>
    <error-code>500</error-code>
    <location>/errors/500.htm</location>
  </error-page>

  <error-page>
    <error-code>404</error-code>
    <location>/errors/404.htm</location>
  </error-page>


  <!-- Struts Tag Library Descriptors -->
  <taglib>
    <taglib-uri>/tags/struts-bean</taglib-uri>
    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
  </taglib>

  <taglib>
    <taglib-uri>/tags/struts-html</taglib-uri>
    <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
  </taglib>

  <taglib>
    <taglib-uri>/tags/struts-logic</taglib-uri>
    <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
  </taglib>

  <taglib>
    <taglib-uri>/tags/struts-nested</taglib-uri>
    <taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
  </taglib>

  <taglib>
    <taglib-uri>/tags/struts-tiles</taglib-uri>
    <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
  </taglib>

</web-app>

0 个答案:

没有答案