Tomcat URIEncoding="UTF-8" in eclipse tomcat setting page

10k Views Asked by At

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. But each time eclipse publishes the project, it will rewrite the server.xml file and deletes my configurations.

I wanted to find a way to set URIEncoding="UTF-8" in eclipse tomcat settings page. 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.

Thanks in advance.

2

There are 2 best solutions below

1
Umais Gillani On BEST ANSWER

In {workspace}/Servers you will find a folder for every Tomcat configuration, containing several configuration files, including the server.xml. There you then can edit the file directly.

To get changes taken into account restart Eclipse.

3
Ye Win On

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. You can edit the same encoding configuration settings inside Server project/folder in your eclipse workspace.

So when you run again and again, your settings will never overwrite.