Comb some of the web's general concepts

Source: Internet
Author: User

The classes in the servlet are good for looking through documents, familiar with the common methods of each class, and looking at some classic case code.

ServletConfig

Each project has more than one servlet, and each servlet corresponds to a Servletconfigt object. The configuration information for each servlet is encapsulated in ServletConfig, specifically the configuration content in <servlet></servlet> in Web. Xml.

You can use Httpserlet's This.getserletconfig method to get ServletConfig

ServletContext:

Each project corresponds to a servletcontext,servletcontext entity package that corresponds to the configuration information in Web. XML, which contains more content. You can use Thi.getservletconfig (). Getservletcontext () in a servlet to get ServletContext can also be obtained directly using This.getservletcontext directly () , which is also the first method of invocation.

As can be seen from the above, the range of ServletContext is larger than the range of ServletConfig.

Domain objects in a servlet

Servletcontext,httpservletrequest,httpsession.

Domain objects in JSPs (of course, jsp9 large built-in objects)

  applicaltion, Httpservletrequest,httpsession,pagecontext. Application is actually ServletContext (you can directly see the JSP translated into the Java file)

Comb some of the web's general concepts

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.