Ii.. Web. xml file configuration-Java development Enterprise-level rights management system

Source: Internet
Author: User

<?xml version= "1.0" encoding= "UTF-8"?>
<web-app xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xmlns= "Http://java.sun.com/xml/ns/javaee" xmlns : web= "http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation= "Http://java.sun.com/xml/ns/javaee Http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd "id=" webapp_id "version=" 2.5 ">

<display-name>archetype Created Web application</display-name>

<!--is responsible for monitoring the context Spring-beans load-
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<!--Spring Beans configuration file Directory--
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>

<!--path issues:
Do not specify CLASSPATH: The default directory is below Web-inf
Specify classpath: Go back below the resources directory
-

<!--spring MVC configuration--
<servlet>
<servlet-name>spring</servlet-name>
<!--request to distribute the corresponding Spring-servlet.xml configuration file, prefixed with spring and servlet one by one,
The suffix-servlet is fixed, and spring automatically reads the files defined in this format--
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/</url-pattern>
<!--Why use/path matching instead of/* suffix type matching?
The Dispatcherservlet is not passed through the view parser when it returns to the JSP view.
The JSP page request also does not hit the servlet,jsp container built-in JSP Servlet is called
-
</servlet-mapping>

<!--filter for Project code configuration--
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<!--parameter Configuration--
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<!--forced encoding. Force the use of UTF-8 encoding--
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<!--Druid Configuration--
<servlet>
<servlet-name>DruidStatServlet</servlet-name>
<servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>
<!--login Verification configuration-
<init-param>
<param-name>loginUsername</param-name>
<param-value>druid</param-value>
</init-param>
<init-param>
<param-name>loginPasswoord</param-name>
<param-value>druid</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>DruidStatServlet</servlet-name>
<url-pattern>/sys/druid/*</url-pattern>
</servlet-mapping>

<filter>
<filter-name>DruidStatFilter</filter-name>
<filter-class>com.alibaba.druid.support.http.WebStatFilter</filter-class>
<init-param>
<param-name>exclusions</param-name>
<param-value>*.js,*.css,*.jpg,*.png,*.ico,*.gif,/sys/druid/*</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>DruidStatFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

</web-app>

Ii.. Web. xml file configuration-Java development Enterprise-level rights management system

Related Article

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.