This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes URLRewriteFilter for ROOT? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "URLRewriteFilter for ROOT?" Watch "URLRewriteFilter for ROOT?" New topic
Author

URLRewriteFilter for ROOT?

Michael Cropper
Ranch Hand

Joined: Sep 30, 2009
Posts: 137
Hi, I have been looking around on how to use URLRewriteFilter for how I can map "http://localhost/" to a servlet. Either I am missing something blindingly obvious, or this isn't as simple as I was hoping.

Does anyone know how to map the ROOT of a web application to a servlet?

I tried doing this in web.xml, although when using "/" as the url-pattern this throws everything through the servlet including images and all.

Thanks
Michael
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

Make the web app the ROOT application and set up a "welcome file" to the servlet mapping.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Michael Cropper
Ranch Hand

Joined: Sep 30, 2009
Posts: 137
Do you mean setting up something like this?



Michael
Michael Cropper
Ranch Hand

Joined: Sep 30, 2009
Posts: 137
This has solved the issue.

I will post the other question in a new topic to stop things getting confusing.

Thanks for the help

Michael
 
Don't get me started about those stupid light bulbs.
 
subject: URLRewriteFilter for ROOT?