• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: 小 中 大 | 推荐给好友 上一篇 | 下一篇

web.xml和struts-config.xml的配置

发布: 2007-7-01 18:47 | 作者: admin | 来源: | 查看: 33次 | 进入软件测试论坛讨论

领测软件测试网 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>指定了标记库描述文件的位置
4,<welcome-file-list>配置在web app中输入有效的,但不完整的url所使用的default resource;不使用servlet映射
<welcome-file>起始和结束都没有/符号
5,<error-page>
(<error-code> <location>)
<<exception-type><location>
</error-page>

二、Struts配置文件
ApplicationConfig: 包含了struts配置文件中的所有信息
1, <data-source>
<set-property property=““ value=““/>
<data-source>
2,<form-beans>
<form-bean name=“loginForm“ type=“完全限定的类名,是ActionForm的子类“>
<form-property name=““ type=““/>
</form-bean>
<form-bean
</form-beans>
3,<global-exceptions>
4,<global-forwards>



作者Blog:http://blog.csdn.net/wjsfr/

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:[email protected] 电话:010-51297073

软件测试 | 领测国际 | ISTQB | ISTQB官网 | TMMi | TMMi认证 | 国际软件测试工程师认证 | 领测软件测试网