Struts1 环境搭建

 

 

1.导入jar包

        拷贝\struts-1.2.9-bin\lib下所有jar文件到WEB-INF\lib文件夹下

 

2.创建struts-config.xml(放入所见工程的WEB-INFO文件夹里)

 

<xml version="1.0" encoding="UTF-8" ?>
<!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>

 

 

 

 

 

3. 配置中央控制器(在web.xml中配置)

<servlet>
	<servlet-name>ActionServlet</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>2</load-on-startup>
</servlet>
<servlet-mapping>
	<servlet-name>ActionServlet</servlet-name>
	<url-pattern>*.do</url-pattern>
</servlet-mapping>

 

 

 

 

 

 

4.发布项目,启动服务器测试  

 

 

你可能感兴趣的:(struts1)