Eclipse Tips: File encoding settings for Eclipse Development Web project

Source: Internet
Author: User
Tags java web
There are several ways to set the encoding:
1.window-preferences-general-workspace

2.window-preferences-general-editors-text editors-spelling

3. Right-click the corresponding project or file in the left Package explorer-properties-resource

4.window-preferences-general-content Types

5.Myeclipse Enterprise workbench-files and editors-jsp ...


6. Configure Tomcat encoding, server.xml add uriencoding= "Utf-8" in the tomcat\conf directory. As follows:

    <connector port= "8080" protocol= "http/1.1" connectiontimeout= "20000" 
               redirectport= 
			   "8443" uriencoding= "Utf-8"/>


Experiment: Priority from high to low is 3-1-2

The highest is to specify the encoding in the file, such as the encoding of the file specified in the XML file, in the JSP page.

Note: (1) window-preferences-general-content types also has the option to set the encoding. This is where the encoding is set from the angle of the file type, and the files with different suffix names are encoded

(2) ANSI (ISO-8859-1) to utf-8 conversion Normal, utf-8 to ANSI is a problem (recommended to open the Notepad++,myeclipse,dreamweaver, see if there are problems)

(3) The Java Web Project can also control the encoding by configuring the filter. Reference: http://blog.csdn.net/lovesummerforever/article/details/9924413

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.