Today Tanabata Festival, bitter force I still write web page to look at the question ... Go to bed early, bye.
Let's go
The difference between 1.forward and redirect
For:
forward is the server requests the resource, the server directly accesses the URL of the destination address, reads the response content of that URL, and then sends the content to the browser, the browser does not know where the server sends the content from, so its address bar is the original address.
redirect is the server based on logic, send a status code, tell the browser to request the address again, in general, the browser will use all the parameters just requested again, so the session,request parameters can be obtained.
What are the built-in objects for 2.jsp? What are the roles?
For:
Request client requests, this request will contain parameters from the Get/post request
Response Web page back to the client's response
The properties of the PageContext Web page are managed here
Session period associated with the request
What the application servlet is doing
Output used to transmit a response
Config Servlet's architectural parts
Page JSP webpage itself
Exception exceptions for error pages, not captured
Basic architecture of 3.Servlet
For:
publicclass ServletName extends HttpServlet {publicvoiddoPostthrows ServletException, IOException { } publicvoiddoGetthrows ServletException, IOException { }}
4. Under what circumstances are doget () and DoPost () called?
For:
The method property in the form tag in the JSP page is called doget () when it is get, and DoPost () is called when it is post.
What are the similarities and differences between 5.JSP and Servlet, and what are their connections?
For:
JSP is the extension of servlet technology, which is essentially a simple way for servlets to emphasize the appearance of application . The JSP is compiled with a "class servlet". The main difference between Servlets and JSPs is that the application logic of the servlet is in the Java file and is completely detached from the HTML in the presentation layer. The case for JSP is that Java and HTML can be combined into a file with a. JSP extension. JSPs focus on Views, and Servlets are used primarily for control logic.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced. Please give me a lot of advice ~
Five Java-related face questions per day (6)