Two jump methods of JSP

xiaoxiao2021-03-06  106

// Note: Do not recommend Chinese file name, "Destination page .jsp", here is only used for tutorials

// With session, do not take a request to jump

Response.sendRedirect ("Destination page .jsp");

// With session, jump with Request

// Need to add parameters in Request: Request.setttribute ("MyVar", "Value");

/ / Get parameters in the destination page: string myvar = request.getattribute ("myvar") == NULL? ": (String) Request.getattribute (" MyVar ");

Request.getRequestDispatcher ("Destination Page .jsp"). Forward (Request, Response);

转载请注明原文地址:https://www.9cbs.com/read-103800.html

New Post(0)