Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the classic JSP test questions?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces what are the classic JSP test questions, which are introduced in great detail and have certain reference value. Friends who are interested must finish reading them.

What are the built-in objects in JSP 1.jsp? What are the functions respectively?

A: there are 9 basic built-in components in JSP (which can correspond to 6 internal components of ASP):

Request client request, which contains parameters from the GET/POST request

The response web page sends back the response from the client

The properties of pageContext pages are managed here

Session session period related to the request

What applicationservlet is doing

The output that the out uses to send the response

Architectural components of configservlet

The pageJSP page itself

Exception for error pages, uncaught exceptions

What are the actions of JSP 2.jsp? What are the functions respectively?

A: there are six basic actions in JSP

Jsp:include: introduce a file when the page is requested.

Jsp:useBean: find or instantiate a JavaBean.

Jsp:setProperty: sets the properties of JavaBean.

Jsp:getProperty: outputs the properties of a JavaBean.

Jsp:forward: redirect the request to a new page.

Jsp:plugin: generate OBJECT or EMBED tags for Java plug-ins based on browser type

The difference between 3.forward and redirect in JSP examination questions

A: forward is a resource requested by the server. The server directly accesses the URL of the target address, reads the response content of that URL, and then sends it to the browser. The browser has no idea where the content sent by the server comes from, so its address bar is still the original address.

Redirect means that the server sends a status code according to logic, telling the browser to request that address again. Generally speaking, the browser will re-request with all the parameters just requested, so the session,request parameters can be obtained.

What is the difference between dynamic INCLUDE and static INCLUDE in JSP test question 4.JSP?

A: dynamic INCLUDE is implemented with jsp:include action. It always checks the changes in the included files. It is suitable for including dynamic pages. Static INCLUDE with parameters can be implemented with include pseudo code. It certainly does not check the changes in the included files. It is suitable for including static pages.

JSP question 5. What are the two ways of jumping? What's the difference?

A: there are two kinds, which are:

The former page does not go to the page referred to by include, but only displays the results of that page, and the main page is still the original page. It will come back after execution, which is equivalent to a function call. And can take parameters. The latter completely turns to the new page and will not come back. Is equivalent to a goto statement.

The built-in object and method of JSP examination question 6.JSP

Answer: request stands for HttpServletRequest object. It contains information about browser requests and provides several useful methods for getting cookie,header, and session data.

Response represents a HttpServletResponse object and provides several methods for setting the response sent back to the browser (such as cookies, header information, etc.)

The out object is an instance of javax.jsp.JspWriter and provides several methods that you can use to echo the output to the browser.

PageContext represents a javax.servlet.jsp.PageContext object. It is an API that facilitates access to a variety of namespaces and servlet-related objects, and wraps general servlet-related functions.

Session represents a requested javax.servlet.http.HttpSession object. Session can store user's status information.

Applicaton represents a javax.servle.ServletContext object. This helps to find information about the servlet engine and the servlet environment

Config represents a javax.servlet.ServletConfig object. This object is used to access the initialization parameters of the servlet instance.

Page represents an instance of servlet generated from this page

The above is all the contents of the article "what are the Classic JSP Test questions?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report