Summary of jsp learning notes

Source: Internet
Author: User

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 %>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.