Two Laptop Bag*
The moose likes Servlets and the fly likes Make Servlet as the welcome page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Make Servlet as the welcome page" Watch "Make Servlet as the welcome page" New topic
Author

Make Servlet as the welcome page

Harsha Nadiger
Greenhorn

Joined: Jun 06, 2010
Posts: 6
Hi,

I have servlet MyServlet and I need to invoke that as the welcome page, like the index.jsp.
I mean when I go the link http://mysite.com , the servlet MyServlet should be invloked.

I know this can be done by calling the servlet from the welcome page index.jsp, which I cannot do due to some constraints.

Is there any way to make a servlet as the welcome page? Please help.

Thanks,
Harsha
sudhir nim
Ranch Hand

Joined: Aug 29, 2007
Posts: 212

You can use the servlet url pattern in welcome file list


[Servlet tutorial] [Servlet 3.0 Cook Book]
Michael Cropper
Ranch Hand

Joined: Sep 30, 2009
Posts: 137
Or there is the URL Rewrite Filter available here, http://code.google.com/p/urlrewritefilter/

I haven't got my head around this myself yet, but I have been recommended the above for the same problem you are asking about :-)

Michael
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Make Servlet as the welcome page
 
Similar Threads
servlet path
Virtual host, Alias and ROOT dir
Welcome file & resource constrained.
Filter Mapping Doubt
Is MyServlet Thread Safe