• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

deployment directory

 
chailin fong
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Refer to the Tomcat documentation for setting up contexts.
[ October 16, 2007: Message edited by: Bear Bibeault ]
 
chailin fong
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic