How to process .JSP files from any directory (below root) using Tomcat & Apache?

Alessandro A. Garbagnati



[Is it possible to configure Tomcat/Apache such that .JSP files that reside in ANY directory beneath the web root will be processed by Tomcat? Or, do I need to setup my website as a single web application at the root level?]

I think you have to tell Tomcat that its root application correspond to Apache DocumentRoot:
<Context path="/" docBase="/usr/local/apache/htdocs" ... />
Plus the two standard lines:
AddType test/jsp .jsp
AddHandler jserv-servlet .jsp

(ps: remember to 'hide' /WEB-INF and /META-INF)

I think that you need to set up an application, because Tomcat requires a ServletContext and it handles internally the paths and addresses, using the docbase and addressbase of that context.

[Alternately, you could tell *Apache* that the document root for this virtual host is the location of your *webapp* root. E.g.

ServerName www.purpletech.com
DocumentRoot /usr/local/jakarta-tomcat/webapps/purpletech