struts1.3的环境搭建

1) 导入jar包:
lib目录中,全部导入
2) 在WEB-INF目录下创建struts-config.xml
基本结构:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
          "http://struts.apache.org/dtds/struts-config_1_3.dtd">

<struts-config>
    <form-beans>
    </form-beans>
    <action-mappings>
    </action-mappings>
</struts-config>


3) 在web.xml中配置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>
  	<load-on-startup>0</load-on-startup>
  </servlet>
  <servlet-mapping>
  	<servlet-name>action</servlet-name>
  	<url-pattern>*.do</url-pattern>
  </servlet-mapping>

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