Fork me on GitHub

n. Slang a rough lawless young Kuali developer.
[perhaps variant of Houlihan, Irish surname]
kualiganism n

Blog of an rSmart Java Developer. Full of code examples, solutions, best practices, et al.

Tuesday, August 28, 2012

Tomcat JSP trimSpaces Optimization Improvement

Overview

There was a thread awhile back on Remove blank spaces from HTML generated from Kuali JSP's. Basically, Bin had an issue where some KFS documents were so huge, that it was leading to performance problems. There was some discussion on several solutions. I wanted to point out one really easy one that eliminates the redundant whitespace in all JSP files with just 4 lines in your tomcat web.xml file.

Details

Wherever your tomcat installation is, it probably looks something like this:
(02:26:25) [3] ls -ldh /Library/Tomcat/Home/*
-rw-r--r--@   1 leo  staff    55K Mar 31 07:45 /Library/Tomcat/Home/LICENSE
-rw-r--r--@   1 leo  staff   1.2K Mar 31 07:45 /Library/Tomcat/Home/NOTICE
-rw-r--r--@   1 leo  staff   8.6K Mar 31 07:45 /Library/Tomcat/Home/RELEASE-NOTES
-rw-r--r--@   1 leo  staff    10K Mar 31 07:45 /Library/Tomcat/Home/RUNNING.txt
drwxr-xr-x@  26 leo  staff   884B Jun 12 05:41 /Library/Tomcat/Home/bin
drwxr-xr-x@  10 leo  staff   340B Aug  6 03:29 /Library/Tomcat/Home/conf
drwxr-xr-x@  21 leo  staff   714B Mar 31 07:44 /Library/Tomcat/Home/lib
drwxr-xr-x@ 173 leo  staff   5.7K Aug 23 09:02 /Library/Tomcat/Home/logs
drwxr-xr-x@   3 leo  staff   102B Mar 31 07:44 /Library/Tomcat/Home/temp
drwxr-xr-x@   9 leo  staff   306B Aug 23 13:25 /Library/Tomcat/Home/webapps
drwxr-xr-x@   3 leo  staff   102B Jun 12 05:53 /Library/Tomcat/Home/work

In $CATALINA_HOME/conf/web.xml replace:



with



After doing this, you need to clean out the $CATALINA_HOME/work path. If you don't, nothing will change.

Enjoy

No comments:

Post a Comment