• struts1x


    struts1x配置:

    1,将struts lib下的所有jar包拷贝到工程项目的web-inf/lib目录下

    2,在web.xml中配置struts1.x,ActionServlet

     <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>


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

    3,提供struts-config.xml文件

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

    <!DOCTYPE struts-config PUBLIC
              "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
              "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">

    <struts-config>
    </struts-config>

    可以在struts包下找到实例项目,在其中找到配置文件粘贴复制即可。

  • 相关阅读:
    链式栈的C++实现
    Java面试之设计模式二
    前端资源
    Java面试之异常
    Java面试之序列化
    Java面试之重写(Override)与重载(Overload)
    项目视图展示
    Java面试之集合
    Java面试之SSH框架面试题集锦
    JDBC技术
  • 原文地址:https://www.cnblogs.com/jinzhengquan/p/1952582.html
Copyright © 2020-2023  润新知