首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

struts1的配备

2012-09-14 
struts1的配置1、web.xml中配置servlet??servlet-nameaction/servlet-name??servlet-classorg.apac

struts1的配置

1、web.xml中配置

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

2、struts-config.xml中配置

<?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>
?<action-mappings>
??<action input="/index.jsp" path="/test" scope="session"
???type="com.test.TestAction">
???<forward name="success" path="/success.jsp" />
??</action>

?</action-mappings>
</struts-config>

热点排行