Solve the Problem of garbled characters when the jsp: include file is referenced, jspinclude

Source: Internet
Author: User

Solve the Problem of garbled characters when the jsp: include file is referenced, jspinclude

Before explaining the problem, let's take a look at the garbled page in the iframe on the left side of the picture below;

This is the garbled code that makes me Tangle for a while:

This error occurs when the <jsp: include> label is referenced on this garbled page;

 

Source code:

At first, I thought it was a file encoding problem, so various solutions were possible;

It is said that when jsp include dynamic files (jsp files), code can be added to the header of the included jsp file:

<% @ Page language = "java" contentType = "text/html; charset = UTF-8" pageEncoding = "UTF-8" %>

 

For example:

Even if the problem persists, why?

In fact, there is no mistake in this method on the Internet. I personally think that some problems in specific operations cannot be treated equally, so we must treat them differently;

 

Solution:

After nearly half an hour of hard work, I added the following code to the first line of the referenced and referenced files angrily, And the headache then vanished;

<% @ Page language = "java" contentType = "text/html; charset = UTF-8" pageEncoding = "UTF-8" %>

 

 

 

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.