简体   繁体   English

Eclipse Tomcat设置页面中的Tomcat URIEncoding =“ UTF-8”

[英]Tomcat URIEncoding=“UTF-8” in eclipse tomcat setting page

I have eclipse neon which is working correctly with Apache Tomcat 7, and now I want to set URIEncoding="UTF-8" for tomcat's connector. 我的eclipse neon可以与Apache Tomcat 7一起正常使用,现在我想为Tomcat的连接器设置URIEncoding =“ UTF-8”。 But each time eclipse publishes the project, it will rewrite the server.xml file and deletes my configurations. 但是,每次eclipse发布项目时,它将重写server.xml文件并删除我的配置。

I wanted to find a way to set URIEncoding="UTF-8" in eclipse tomcat settings page. 我想找到一种在Eclipse Tomcat设置页面中设置URIEncoding =“ UTF-8”的方法。 There is an option in launch configuration (in tomcat settings page) in common tab as Encoding and I set it to UTF-8, but it is not working too. 启动配置(在tomcat设置页面中)的公共选项卡中有一个选项为编码,我将其设置为UTF-8,但它也无法正常工作。

Thanks in advance. 提前致谢。

That is the full sentence for encoding case. 这是用于编码情况的完整句子。

<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000"  redirectPort="8443"  URIEncoding="UTF-8" />

But yes I think your problem is not related with this sentences because it seen correct. 但是,是的,我认为您的问题与这句话无关,因为它看起来正确。 I have the one alternative way to prevent to not overwrite your server.xml file when restart. 我有一种替代方法,可以防止重新启动时不覆盖您的server.xml文件。 You can edit the same encoding configuration settings inside Server project/folder in your eclipse workspace. 您可以在Eclipse工作区的Server project/folder中编辑相同的编码配置设置。

So when you run again and again, your settings will never overwrite. 因此,当您一次又一次地运行时,您的设置将永远不会被覆盖。

In {workspace}/Servers you will find a folder for every Tomcat configuration, containing several configuration files, including the server.xml . {workspace} / Servers中,您将找到每个Tomcat配置的文件夹,其中包含几个配置文件,包括server.xml There you then can edit the file directly . 然后,您可以那里直接编辑文件

To get changes taken into account restart Eclipse . 要考虑更改,请重新启动Eclipse

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM