• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

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: 67502
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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: 67502
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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
 
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic