Some simple problems in "Jsp/servlet" Javaweb

Source: Internet
Author: User

1 How JSP works

For:

The Dynamic Web technology standard BLABLA...JSP program works in the request/Response mode, the client issues an HTTP request, the JSP program receives the request, processes it, and returns the result of the processing.

JSP programs need to be run on a particular Web server, such as Tomcat,weblogic. All JSP files will be executed by the server-side JSP engine into the servlet program (Java source file), and then call the Java compiler to compile the servlet program as a class file, and the Java virtual machine to interpret the execution.

When a client browser requests a JSP page (for example, test.jsp) from a Tomcat server, it generates two files in the%catalina_home%\work\catalina\ directory, _test_jsp.java and _test_, respectively Jsp.class, they are servlet programs and class files that are generated based on JSP pages.

2 JSP nine large built-in objects (interview was asked 100 times, or sometimes do not remember the whole.) )

Request response Out Session Application Page PageContext config exception

3 page, request, session, main differences between application objects

(1) Different types

The page is of type object, request is HttpServletRequest type, session is HttpSession type, and application is ServletContext type

(2) different scope of action

Application: global scope, entire application sharing, life cycle from application startup to stop

Session scope, when the user first accesses a new session, the server can remember the session state, the life cycle is the session time-out or the server-side forces the session to expire.

Request: A request scoped by the client. Lifecycle requests or uses forward to perform request forwarding

Page: A JSP page is valid

The scope of Page,request,session,application objects is increasing, and the life cycle of the request and page is short. The difference between them is that a request can die with multiple page pages (Include,forward and filter)

Some simple problems in "Jsp/servlet" Javaweb

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.