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 deployment directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "deployment directory" Watch "deployment directory" New topic
Author

deployment directory

chailin fong
Greenhorn

Joined: Oct 15, 2007
Posts: 10
Hi

I am using Tomcat 5.028. How to configure tomcat to run jsp files without copy the files to /<tomcat-installation-dir>/webapps/...

For example, c:\myJsp\test.jsp

Thanks.
Michael Ku
Ranch Hand

Joined: Apr 20, 2002
Posts: 510
I don't understand your question. Are you trying to run a JSP without going thru the Servlet container as if this werer a little problem with a main method?
chailin fong
Greenhorn

Joined: Oct 15, 2007
Posts: 10
What I meant was , if I put all my jsp files in one directory, named "c:\myJSP"

Without placing the file into /tomcat/webapps/.. directory, the URL link will "point" to "c:\myJSP\test.jsp
ie, http://localhost:8080/myjsp/test.jsp

Editing server.xml?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60997
    
  65

Refer to the Tomcat documentation for setting up contexts.
[ October 16, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
chailin fong
Greenhorn

Joined: Oct 15, 2007
Posts: 10
I add the line below in server.xml
<Context path='/jspbook' docBase='c:\jspbook' debug='0' reloadable='true'>
</Context>

I try to access the application: http://localhost:8080/jspbook/hello.jsp

I got : HTTP Status 404 - the requested resource (/jspbook/hello.jsp) is not available.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by chailin fong:
I add the line below in server.xml
<Context path='/jspbook' docBase='c:\jspbook' debug='0' reloadable='true'>
</Context>

I try to access the application: http://localhost:8080/jspbook/hello.jsp

I got : HTTP Status 404 - the requested resource (/jspbook/hello.jsp) is not available.



It would be better to follow Bear Bibeault's directions and check the documentation. Adding context entries to the server.xml file is not considered a best practice in Tomcat 5.0 and up.
Also, Tomcat will not treat your directory as a web application unless there is a proper directory structure within it.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
wood burning stoves
 
subject: deployment directory