Configuring Tomcat
After installation, you must update the default Tomcat configuration files with the appropriate settings.
About this task
- UTF-8
By default, Tomcat assumes that requests are encoded with ISO-8859-1 instead of UTF-8. This default setting can break string handling if request parameters contained UTF-8 extended characters. For correct string handling, you must add the useBodyEncodingForURI="true" parameter to the <Connector> element of the server.xml configuration file.
- POST Data limit
By default Tomcat limits POST data to 2 MB. This limit can cause an issue when you use rule sets, which can post data greater than this limit. To disable the POST limit in Tomcat, you can add the maxPostSize="-1" attribute to the <Connector> element of the server.xml configuration file.
- Non-ASCII characters in Java source files
Tomcat converts JSPs into servlets that are contained in UTF-8 encoded Java sources files by default (for multi-byte character support). These files are generated into the work folder of the project. The Sysdeo plug-in marks the work folder as an Eclipse source folder. If you use the Eclipse build command, the Java compiler expects system encoding sources files by default. If any source file in the work folder contains non-ASCII characters, such as ú, an
Invalid Character
compiler error is generated and you cannot access the page in a web browser.The
keepgenerated
attribute prevents Tomcat from saving the source files in the work folder and avoids this problem. You can prevent this occurring by updating the Tomcat web.xml configuration file with a newinit-param
element.The Eclipse compiler cannot be changed to compile UTF-8 source files because of a second source folder that is called JavaSource that contains files that are not in UTF-8 encoding. Changing this setting does not affect the use of the application in any way. The
keepgenerated
parameter can be set to true if you want to view and debug through source files that are generated by Tomcat, but the error and browser access problem then occurs.