• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

deployment directory

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic