Java Web-- page jump

There are ways to jump page: redirects and forwards the request

  • request.setAttribute () put data
  • the request.getAttribute () to take data

If there is no request data field, using redirection Jump:  Response.sendRedirect ();

If there is data request domain, use request forwarding Jump:

先  request.setAttribute() ;

Then request.getRequestDispatchar ( "destination page") .forward (request, response) ;

 

Compare the following two ways:

Guess you like

Origin blog.csdn.net/weixin_42153410/article/details/90770571