• 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

topcat and adding new directory in webapps

 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am working on a new site called Lampoons. I wish to store all of the sites required files(jsp, servlets, classes, html) in this directory. I have created a new directory called "Lampoons" in webapps but I am unable to get the default index.html page in this directory(Lampoons) to load.
Do I have to update the server.xml file and if so how? I mean what do I have to insert in there and where?
Thank you so much.
Really like this site
david
 
Sheriff
Posts: 67747
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
Yes, unless you plunk your folder under the ROOT web app (which you don't want to do since that will just add your stuff to an existing web app rather than creating a new one of your own), you need to define a new 'context'.
For Tomcat, the following example (lifted from my server.xml) shows a new context definition.

The context is declared within the <Host> element of the server.xml file.
Once Tomcat is restarted, the url http://myserver:8080/trf/ would be used to access the new context (correct server name and port substituted, of course).
Be sure that the web app located at the specified folder follows servlet spec conventions (WEB-INF and all that stuff).
hth,
bear
P.S. Curse you and your typo! Now I've got the theme song from Top Cat playing in my head and I can't get rid of it!
[ July 03, 2003: Message edited by: Bear Bibeault ]
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I understand it, Tomcat will not recognize your new directory as a "web application" if it does not have a WEB-INF with a web.xml file in it.
You should not have to modify server.xml, just create WEB-INF and web.xml
Bill
 
Bear Bibeault
Sheriff
Posts: 67747
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
To join my and William's seemingly conflicting posts:
You need the context declaration in server.xml if your folder doesn't exist under the Tomcat webapps folder (my example).
You don't need it (William's point) if you plunk the folder under webapps and it conforms to servlet standards (WEB-INF, web.xml and so on).
hth,
bear
 
david allen
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks guys.
have it working
david
reply
    Bookmark Topic Watch Topic
  • New Topic