jsp interview related questions

How are JS P requests handled?

reference answer

The browser first needs to request a page ending with a .jsp extension, initiate request , and then the Web server reads the request and uses the JSP compiler to convert the JSP page into a Servlet class . It should be noted that only when the page is requested for the first time or the JSP file is changed, the JSP file will be compiled , and then the server will call the servlet class to process the browser's request. Once the request execution is complete, the servlet will send the response to the client. Here 's how to get request parameters in JS P.  


What is a JS P directive (Directive) ? What are the different types of directives in JS P ?

reference answer

Directive is the instruction to be processed by the JSP engine when the JSP page is compiled into a servlet . Directive is used to set page-level directives , insert data from external files , and specify custom tag libraries . Directives are defined between <%@ and %> . The different types of Directives are listed below :  

Include directive (Include directive) : used to include files and merge file content into the current page.

Page directive (Page directive) : used to define specific properties in the JSP page , such as error pages and buffers. Tagli b directive: used to declare the custom tag library used in the page.  

What is a JSP action ( JSP action) ?

reference answer

JS P actions control the behavior of the servlet engine with the structure of XML syntax . When the JSP page is requested, the JSP action will be executed . They can be dynamically inserted into files , reuse JavaBean components , forward users to other pages, or generate HTML code for Java plugins . The available actions are listed below:

jsp:include- Include a file when a JS P page is requested.

jsp:useBean- Find or initialize Javabeans .

jsp:setProperty- Set the properties of the JavaBean .

jsp:getProperty- Get the properties of the JavaBean .

jsp:forward- Forward the request to a new page.

jsp:plugin- Generate browser-specific code.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326449433&siteId=291194637