Questions base face (c)

1. http get and post requests in the difference between:

  get requests submitted data will be displayed in the address bar, post requests are not displayed in the address bar. After submitting the requested data will get attached to the URL (that is, the data is placed in the HTTP protocol headers) to? Segmentation URL and transmit data, a plurality of connection parameters &; post data submission is placed on the package body HTTP packet.

  get request due to limitations on the length of the browser address bar of the resulting transmission data is limited. The post request will not result in transmission of address and data length limit restriction.

  Get the security post of safety than others. Since the data will appear in the address, so you can find key information such as passwords by history.

 

2.Session and Cookie difference:

  session cookie and all session tracking technology. cookie records information by the client to determine the identity of the user, session by recording the information on the server to determine the user's identity. But the session's implementation depends on the cookie, sessionId (session that uniquely identifies the need to be stored on the client side).

  "Cookie unsafe, Session accounting memory" cookie data is stored on the customer's browser, session data on the server. cookie is not very safe, people can analyze the presence of a local cookie and cookie deception. session will be saved in a certain time on the server when accessing the increase, it would be more occupied server performance. Single cookie saved data can not exceed 4k, many browsers are limited to a maximum of 20 cookie to maintain a site.

  So, in conclusion,. The login information and other important information is stored for the session, additional information if necessary, it can be stored in a cookie.

 

3.Servlet understanding

  java Servlet, written in java using server-side program. These Servlet must implement these interfaces, the main function is to interactively view and modify data, generate dynamic web content.

  HttpServlet doGet and rewrite or overwrite the service method doPost method to complete the get and post requests.

 

4.Servlet life cycle

  

 

5.Servlet API difference in the forward () and redirect () of

  forward () is a server-side steering and redirect () is a Jump client.

  Use forward () the browser's address does not change, and redirect () will change.

  forward () is a request to complete, and redirect () is to re-initiate the request.

  forward () is done on the server side, rather than the client request to reinitiate high efficiency.

 

6.MVC various parts of what are the techniques to achieve

  M (model) model for example: javabean

  V (view) view example: html, jsp

  C (control) controller, such as: servlet

    Overall, MVC architecture, the model, the display of data storage relies View control, change control data using the Controller. Three each think their job. The program structure using the MVC pattern not use MVC compared program structure more clearly, the code read.

 

Guess you like

Origin www.cnblogs.com/fzzzjjj/p/11277761.html