Several pages jump method

Page jump mode 1 - herf

  In some html document, implement page jump with herf more common, also good to use.

Page jump way 2-- use the form action

 

<td>
      <form method="post" action="ChangrCount.jsp" id="form1">
              <input type="hidden" name="albumId" value="${item.albumId}" />
              <input style="width:50px;" type="text" name="count" value="${item.count}" id="namecount"/>                                
      </form>
</td>

Page jump method 3 - response.sendRedirect ( "cart.jsp");

esponse.sendRedirect ( "cart.jsp"); function is to address redirection (page jump);     


Four methods of steering the server:
1. The ServletContext getRequestDispatcher ()
path must be absolute path relative context
2. servletcontext of getNamedDispatcher ()
3. The ServletRequest getRequestDispatcher ()
may be relative or absolute
4. servletresponse of sendredirect () steering.

 

response.sendredirect (url); server redirect response. When the server responds to the request of the client life cycle of the client was terminated. 
This time again request.getparameter () or request.getattribute () can only be obtained null.
. Getservletcontext () getrequestdispatcher (url) .forward (request, response); it is a client may be considered a request (request) passed before the server is not responding, i.e., no response has been transmitted may be - redirected.
 

Guess you like

Origin www.cnblogs.com/zybcn/p/10974598.html