Change default page from index.html to servlet
1 posts in topic
Flat View  Flat View

Posted By:   Maxim_Markaitis
Posted On:   Friday, January 18, 2002 05:28 AM

I know I can change content of index.html of the ROOT dir to make redirect on servlet. but the url after redirecting will be http://www.sitename.com/Sitename/servlet/ServletMainClass. I need url of servlet be http://www.sitename.com/ServletMainClass. And let it be default page instead of index.html.

Re: Change default page from index.html to servlet

Posted By:   AlessandroA_Garbagnati  
Posted On:   Friday, January 18, 2002 05:39 AM


The URL for calling a servlet in a normal situation can be described as:


The 'virtual' directory /servlet/ is the default mapping for accessing to a servlet. Inside a context, this can be changed using the web application descriptor (web.xml) file. There are some examples in the FAQs and Forum's threads here on jGuru, regarding how to change the defualt mapping of a servlet through the and tags. (since is a standard servlet feature, you can find it either on this Topic and on the Servlet topic).

The part of the URL is a different issue. To remove it, you need to have your application set as the default or root context of your servlet-container (using server.xml configuration file), otherwise you cannot take that off.

About | Sitemap | Contact