web.xml parsing

https://blog.csdn.net/u012768459/article/details/70860223

A, web.xml configuration file common elements and their significance Preview

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
20
21
22
24
25
26
29
30
31
33
34
35
36
37
38
39
40
41
42
43
44
46
47
48
49
50
51
52
53
54
55
56 is
57 is 58 59 60 62 is 63 is 64 65 66 67 68 69 70 71 is 72 73 is two, the respective configuration elements Explanation















1.Web application icon: Indicates IDE and GUI tools for Web applications represent large icon and small icon

1
2 /images/app_small.gif
3 /images/app_large.gif
4

2.Web Application Name: Provides a GUI tool may be used to mark the name of a particular Web application

1 Tomcat Example

3.Web Application Description: descriptive text related thereto are given

1 Tomcat Example servlets and JSP pages.

4. The context parameter: initialization parameters declared within the scope of application

. 1
2 Parameter name
3 Parameter Value
4 Parameter Description
5
obtained by a servlet which can getServletContext (). GetInitParameter ( "context / param")

5. Filter configuration: a name and a class that implement interfaces associated javaxs.servlet.Filter

1
2 setCharacterEncoding
3 com.myTest.setCharacterEncodingFilter
4
5 encoding
6 GB2312
7
8
9
10 setCharacterEncoding
11 /*
12

6. Listener configuration

1
2 org.springframework.web.context.ContextLoaderListener
3

7.Servlet Configuration

. 1
2 the servlet name
3 servlet class full path
. 4
5 Parameter name
6 parameter value
. 7
. 8
. 9 Anonymous Access Security Role for
10 Tomcat
. 11
when the Web application 12 specifies when to start, the order of loading the Servlet
13 is
14
15 the name of the servlet
16 is mapped path
17

8. The session timeout configuration (in minutes)

1
2 120
3

9.MIME type configuration

1
2 htm
3 text/html
4

10. Specify the welcome page configuration file

1
2 index.jsp
3 index.html
4 index.htm
5

11. Configure error page

(1). Configured by error-page error code

. 1 2 . 3 404 . 4 /NotFound.jsp . 5   (2). Configured by the anomaly error-page type




1 2 3 java.lang.NullException 4 /error.jsp 5



12.TLD Configuration

1
2 http://jakarta.apache.org/tomcat/debug-taglib
3 /WEB-INF/jsp/debug-taglib.tld
4
if the development tools has been an error, it should be put in place

1
2
3 http://jakarta.apache.org/tomcat/debug-taglib
4 /WEB-INF/pager-taglib.tld
5
6

13. Resource Management Configuration Object

1,
2, etc. / StockQueue
3

14. Resource Factory configuration

. 1
2 mail / the Session
. 3 a javax.mail.Session
. 4 Container
. 5
  database connection pool configuration in this configuration can be

1
2 JNDI JDBC DataSource of shop
3 jdbc/sample_db
4 javax.sql.DataSource
5 Container
6

15. Configure security restrictions

1
2 Example Security Constraint
3
4 Protected Area
5 /jsp/security/protected/*
6 DELETE
7 GET
8 POST
9 PUT
10
11
12 tomcat
13 role1
14
15

16. Verify the landing configuration

1
2 FORM
3 Example-Based Authentiation Area
4
5 /jsp/security/protected/login.jsp
6 /jsp/security/protected/error.jsp
7
8

17. The security roles: security-role element gives a list of security roles, these roles will appear role-name child element of security-role-ref element in the servlet element.
Each role can declare Advanced IDE process safety information easier.

1
2 tomcat
3

18.Web environmental parameters: environmental items env-entry element declares the Web application

1
2 minExemptions
3 1
4 java.lang.Integer
5

19.EJB statement

1
2 Example EJB reference
3 ejb/Account
4 Entity
5 com.mycompany.mypackage.AccountHome
6 com.mycompany.mypackage.Account
7

20. Local EJB statement

1
2 Example Loacal EJB reference
3 ejb/ProcessOrder
4 Session
5 com.mycompany.mypackage.ProcessOrderHome
6 com.mycompany.mypackage.ProcessOrder
7

Third, the summary

These are the configuration and the role of common elements in the web.xml welcome challenge and inappropriate place to learn together

Guess you like

Origin blog.csdn.net/qq_43077857/article/details/90898433