Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

multiple apps on Tomcat

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm trying to figure out how to do this within the server.xml file and it's a bit confusing.

I have 3 (and potentially more) apps on the server that I've got successfully posted and running fine. However, what I'd like to do is this - set up the site to default to myApp1 if the location isnt specified in the browser's URL - http://www.mysite.org/, Tomcat will default point to
the ${TOMCAT_HOME}/webapps/myApp1/ location.

So, the URLs 'http://www.mysite.org/' and 'http://www.mysite.org/myApp1/'
will point to the same location.

I also want to have the alias also handle the URL mappings - http://www.mysite.org/myApp2/
http://www.mysite.org/myApp3/
... (etc)
(and thus run their respective web apps normally.)

It's not very clear reading the literature on the server.xml docs on exactly how to set this up.

I'd appreciate any insights.

Thank you,
Chad
 
Marshal
Posts: 67425
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can set up a context for root and on for myApp1 to point to the same docbase. That will give you two sepaate instances of the same web app though, which may not be what you want.

Othersie, just put an index.jsp in the root docbase of the root web app that redirects to your desired app.
 
    Bookmark Topic Watch Topic
  • New Topic