Response. getWriter (). write () Prints garbled information to the front-end. Solution: response. getwriter

Source: Internet
Author: User

Response. getWriter (). write () Prints garbled information to the front-end. Solution: response. getwriter

Response. getWriter (). write (): displays a piece of information on the front-end page.

In normal url mode, a new page is generated to display the content.

When ajax is used, the content is displayed in alert.

Garbled error using response. getWriter (). write ()

Solution:

Response. setContentType ("text/html; charset = UTF-8"); response. getWriter (). write ("pass the content to display here! ");

ResponsegetWriter () write ()

'<>' Needs to be changed, such as: I <depressed>.
After reading the results, the browser automatically converted my symbols. I separated the characters by 'add'. When you write the code, you can remove 'add': & add lt; and & add gt; note <or> after the semicolon cannot be lost. do you understand?

Why does the content of responsegetWriter () write ("xxxxxxx") in java appear in the title of the page?

Page title?
Is it the title bar of the browser?
Or is the title tag of the html head on the page?
Du tianwei [authoritative expert]

Related Article

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.