1

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.

Naeem Baghi
  • 811
  • 2
  • 14
  • 29

2 Answers2

7

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.

Ye Win
  • 2,020
  • 14
  • 21
1

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.

Umais Gillani
  • 608
  • 4
  • 9
  • Restarting your entire Eclipse IDE is unnecessary. Make the desired edits to the files for your server definition under **{workspace}/Servers** and be sure to save. Then, in the Servers tab, right-click on the corresponding server and choose `Clean...` to re-publish your updated configuration to it. In the case of changing connector configuration, you **will** need to restart the container, but not the entire IDE. – jaguild Jun 07 '23 at 01:21