Simple skill

xiaoxiao2021-04-08  296

The typical basic theory is lacking, getParameter gets information from HTTP's GET, POST request domain, such as xxxx.jsp? SDFSF = zzzz zone here is sending a GET request, there will be SDFSF = ZZZZ key value! You can only Use request.getParamter () to operate! And return always String type, the JSP parser will automatically take the information from a String object to you! And Request.SetAttRibute, all of the operation of Object, their The transmission mechanism and the storage mechanism should be based on Session, the difference is that the range of the range .Request is only used for the current request, and the session is used in the entire session validity period! So you use getParameter to get setttribute, which is of course wrong, Because their access mechanism is different. This is the so-called lip is not the horse!

But there is also a conceptual error, request.settribute () and getAttribute are for a request, definitely not a session period! Many people in this still don't understand the basic concepts.

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

New Post(0)