• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

web-app outside WEB-INF in Tomcat

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends,
The query is whether it's possible to place a web-app outside the WEB-INF directory of Tomcat or not..?? I was wondering if it's possible to place my web-app somwhere in my C:/ and somehow do some mapping and make my application run on Tomcat..

Thanks and Regards,
Mohammad Ibrahim
 
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
Webapps never go in the WEB-INF directory to begin with.

The WEB-INF directory belongs in the root directory of the webapp.

Example:
{tomcat install}/webapps/myApp/WEB-INF/classes/..


If your question was "Can webapps reside in a directory other than the {tomcat install}/webapps directory?" then, yes.
Look a the docBase attribute of the Context element.
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
 
Mohammad Ibrahim
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ben,
that's what I meant.. Thanks..



please tell me in which file should I keep the above code..???
is it context.xml..or the server.xml..or web.xml..or any other..???

Thanks,
mohammad ibrahim
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It may depend on the version of Tomcat, but in 5.x you put it in :
$CATALINA_HOME/conf/[enginename]/[hostname]/Struts1.xml
From: http://tomcat.apache.org/tomcat-5.0-doc/config/context.html

For 4.x, it's in server.xml
http://tomcat.apache.org/tomcat-4.0-doc/config/context.html
 
"To do good, you actually have to do something." -- Yvon Chouinard
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic