1. What built-in objects does JSP have?
A: JSP has the following nine basic built-in components (which can correspond to the six internal components of ASP ):
Request client request, which contains parameters from the get/POST request
Response returned from the response webpage to the client
The pagecontext page is managed here.
Session-related Session Period
Content being executed by application Servlet
Out is used to send response output.
Configuration servlet framework
Page JSP page itself
Exception for the error webpage, exceptions not captured
2. What are the functions of JSP?
A: JSP has the following 6 basic actions:
JSP: include: Introduce a file when the page is requested.
JSP: usebean: Find or instantiate a JavaBean.
JSP: setproperty: Set attributes of JavaBean.
JSP: getproperty: outputs the attributes of a JavaBean.
JSP: Forward: Transfers requests to a new page.
JSP: Plugin: generate the object or embed tag for the Java Plug-in based on the browser type
3. What is the difference between dynamic include and static include in JSP?
Answer: Implement Dynamic include with JSP: include action
It always checks changes in the contained files and is suitable for containing dynamic pages and can contain parameters
Static include is implemented by using the include pseudo code and will not check the changes in the contained files. It is applicable to include static pages.
4.Common JSP commands
Iserrorpage (whether the exception object can be used), iselignored (whether to ignore the expression)
5,JSPWhat are the similarities and differences between them and Servlet?
A: JSP is a servlet.TechnologyEssentially, servlet is a simple method.Application. After JSP compilation, it is "servlet-like ".
The main difference between Servlet and JSP is that the application logic of servlet isFileAnd completely separated from the HTML in the presentation layer. In JSP, Java and HTML can be combined into a file with the extension. jsp.
JSP focuses on views. servlet is mainly used for control logic.
6. How does one implement request forwarding in JSP and Servlet?
JSP forwarding requests can be completed through the <JSP: Forward> standard action. servlet forwarding requests can be implemented through the forward () method.
7. What are the implicit objects in JSP? What are their roles?
Request request indicates the httpservletrequest object. It contains information about browser requests and provides several useful methods for obtaining cookie, header, and session data.
Response response indicates the httpservletresponse object, and provides several methods (such as cookies and header information) for setting the response to the browser)
The out object is an instance of javax. jsp. jspwriter. It provides several methods for sending output results to the browser.
Pagecontext indicates a javax. servlet. jsp. pagecontext object. It is used to facilitate access to various namespaces and servlet-Related Object APIs, and encapsulates common servlet-related functions.
Session session indicates a requested javax. servlet. http. httpsession object. Session can store user status information
Application applicaton indicates a javax. servle. servletcontext object. This helps you find information about the servlet engine and Servlet environment.
Config config indicates a javax. servlet. servletconfig object. This object is used to access the initialization parameters of the servlet instance.
Page page indicates a servlet instance generated from this page.
Exception indicates exceptions generated during JSP page running.
8. What are the two jump methods? What is the difference?
A: There are two types:
the former page does not switch to the page referred to by include, but only displays the results of this page. The home page is still the original page. It will return after execution, which is equivalent to a function call. In addition, parameters can be included. The latter is completely redirected to the new page and will not be returned. It is equivalent to the go to statement.