Summary of jsp learning notes
The size of the stored object is limited in cookies. <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KCjxwPjxpbWcgc3JjPQ = "http://www.2cto.com/uploadfile/Collfiles/20160330/20160330093209528.png" alt = "create and use cookies in jsp" title = "\">
Solve the problem that Chinese characters cannot be saved in cookies:
Request. setCharacterEncoding
URLEncoder. encode () Encoding
URLDecoder. decode () decoding
The include command also contains the source code of the contained file and merges it into a class,
The include action only includes the result or two classes.
The output of the objects obtained by printwriter always comes out of the built-in object. There is a way to make the output of the out object prior to the printwriter object, that is, the flush () method is used to clarify the cache area, in this way, the output can be forced.
To prevent Chinese garbled characters after a form is submitted, add a command before receiving parameters in the request.
Note: The request. setCharacterEncoding method cannot solve the problem of Chinese garbled characters generated by passing parameters through URLs. You can modify the labels in server. xml under the conf folder in the Tomcat directory and add URLEncoding = "UTF-8"
<%! Java code %> <% = expression (value) %> <% script %>