Java Servlet (cont.)

Source: Internet
Author: User

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.)

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.