File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes JSP file location under Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "JSP file location under Tomcat" Watch "JSP file location under Tomcat" New topic
Author

JSP file location under Tomcat

Dave Comeau
Greenhorn

Joined: Jun 14, 2002
Posts: 27
I apalogize if this question is way to newbie. Feel free to point me to a FAQ.
I've just installed Tomcat, along with the mod_webapp.so module for Apache on OSX (http://developer.apple.com/internet/macosx/tomcat1.html). Everything is up and running fine.
The way my httpd.conf is set up now, I have to place all jsp files in a directory seperate from the root web directory, in order for Tomcat to handle them. Here is the config from httpd.conf.

All calls to localhost/examples/ get re-directed from the root web directory, to /usr/local/jakarta-tomcat-4.0.3/webapps/
My question is, can I set up httpd.conf to allow Tomcat to process files by extension, rather than by directory, similar to PHP AddType directive? So I can have .jsp files in my root web directory?
Or is it standard that .jsp files live outside the root web directory tree?
[ June 14, 2002: Message edited by: Dave Comeau ]
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 566
Each main directory under webapps is a web application to Tomcat. ROOT just happens to be the one that be called when you don't type in a directory after localhost on your URL.
If you want your webapp to be the default app for tomcat, just deploy to the ROOT directory. Or tell web.xml (or is it server.xml?) which directory is your root app. Check web/server.xml for the config for ROOT and change or copy it accordingly. They'd be in your tomcat/conf directory.
Adam


I have seen things you people would not believe, attack ships on fire off the shoulder of Orion, c-beams sparkling in the dark near the Tennhauser Gate. All these moments will be lost in time, like tears in the rain.
Dave Comeau
Greenhorn

Joined: Jun 14, 2002
Posts: 27
Thanks Adam. I should have clarified I was talking about the Apache root web directory tree, not the Tomcat ROOT directory.
But things are making more sense to me as I let them sink in, and read everything I can get my hands on.
It looks like mod_jk is the apache module that I'm looking for. That would allow me to put .jsp files in the Apache root web directory, have them comiled my Tomcat, while defining a seperate directory for servlets. Correct?
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 566
Honestly I'm not sure. maybe somebody else knows - there were a couple of others around here who've been playing with tomcat + apache.
Sorry
Adam
Dave Comeau
Greenhorn

Joined: Jun 14, 2002
Posts: 27
Thanks Adam.
Actually, mod_webapp is working out fine for me. I'm just so used to working with PHP and Apache, I want things to be set up the same.
I'm quickly realizing Tomcat is not Apache and JSP is not PHP
[ June 19, 2002: Message edited by: Dave Comeau ]
Andrew Parker
Ranch Hand

Joined: Nov 12, 2001
Posts: 178
Hi Dave,
I have the similar problem with you. Could you tell me how to add the mod_webapp module to the httpd.conf and how to edit web.xml in order to let /home/users to use jsp pages on their apache web server?
Any tutorial or faq is welcome.
Thanks
Andrew
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP file location under Tomcat