Configuration of Web.xml and Struts-config.xml

Source: Internet
Author: User
Configuration of the Web|xml struts application:
The article said controller, but I found that for Jakarta struts in the other content has been forgotten, the ancients cloud: Warm so know new, let me to the front of a few chapters for review
There are two files to configure here, one is web.xml, and the other is Struts-config.xml
First, configure Web.xml for struts
1, configure Actionservlet (only one) so that it receives all requests received by the application
Two steps, a: Configuring Servlet instances with servlet elements, doing servlet-mapping
<web-app>
<servlet>
<servlet-name>storefront</servlet-name>
<servlet-class> fully qualified class name </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>storefront</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-map>
2, configure initialization parameters: Init-param, name/value to express <param-name><param-value>
Config: default is/web-inf/struts-config.xml
config/sub1:config/... Add to the funding program from the additional struts configuration file Sub1
Debugging detail of Debug:servlet
Debugging detail of Detail:digester
Converthack
3,<taglib> must be configured to use the tag libraries provided by struts, including
<taglib-uri> identify the tag libraries used by the Web application and must be valid
<taglib-location> Specifies the location of the tag library description file
4,<welcome-file-list> Configure the default resource used in a valid, but incomplete, url in the Web app; do not use servlet mapping
<welcome-file> Start and end none/symbol
5,<error-page>
(<error-code> <location>)
<<exception-type><location>
</error-page>

Two, struts configuration file
Applicationconfig: Contains all the information in the Struts configuration file
1, <data-source>
<set-property property= "" value= ""/>
<data-source>
2,<form-beans>
<form-bean name= "LoginForm" type= "fully qualified class name, is a subclass of Actionform" >
<form-property name= "" type= ""/>
</form-bean>
<form-bean
</form-beans>
3,<global-exceptions>
4,<global-forwards>



Author blog:http://blog.csdn.net/wjsfr/


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.