I. Web. XML configuration
Because the user needs a URL to access the set up servlet, we must map the servlet to a URL address,
For example, the above configuration file we can access by: http://localhost:8080/JAVAServletTest/2.jsp this URL to .... A servlet page can map multiple URL addresses
<?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" xsi: schemalocation= "Http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id= "Webapp_ ID "version=" 3.0 ">
<servlet>
<servlet-name>ServletTest</servlet-name>
<servlet-class>ServletTest.ServletTest</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ServletTest</servlet-name>
<url-pattern>/2.jsp</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ServletTest</servlet-name>
<url-pattern>/3.jsp</url-pattern>
<servlet-mapping>
<servlet-name>ServletTest</servlet-name>
<url-pattern>/4.jsp</url-pattern>
</servlet-mapping>
</web-app>
Ii. How to avoid data errors caused by data concurrency if the servlet encounters a library part of a public operation
The above two points refer to: http://www.cnblogs.com/xdp-gacl/p/3760336.html this address
Java Servlet (cont.)