config.xml是多么东东

来源:百度知道 编辑:UC知道 时间:2024/06/20 16:46:00

struts应用程序的配置:
上篇文章讲了controller,但是我发现对于Jakarta Struts中的其它内容已经遗忘殆尽,古人云:温故而知新,就让我对前边几章作一下复习
这里要配置的文件有两个,一个是web.xml,另一个是struts-config.xml
一、为struts配置web.xml
1,配置ActionServlet(only one),使其接收应用程序收到的所有请求
分为两步,a:使用servlet元素配置servlet实例,做servlet-mapping
<web-app>
<servlet>
<servlet-name>storefront</servlet-name>
<servlet-class>完全限定的类名</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>storefront</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-map>
2,配置初始化参数:init-param,以name/value表示<param-name><param-value>
config :默认为/WEB-INF/struts-config.xml
config/sub1:config/... 从附加的struts配置文件中加在资程序sub1
debug:servlet的调试detail
detail:Digester的调试detail
convertHack
3,<taglib>使用struts提供的标记库时必须配置包括
<taglib-uri>识别web应用程序所使用的标记库,必须是有效的
<taglib-location