• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Servlet Aliasing

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,
What exactly is servlet aliasing...can anybody explain me in detail....
Thanx in advance for ur effort and time
Bye
Vinay
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wit servlet aliasing the web server maps a request for a particular resource to the servlet class you create. In the servlet 2.2 API this is accomplished in the web.xml file for a particular applications.
For example, the following maps a request for "saynumb.au" to the NumberSoundServ servlet - as qualified by the full package. It also creates an initialization parameter that will be passed to the servlet init method.
<servlet><servlet-name>saynumb.au</servlet-name> <servlet-class>com.JSPbook.Chap04.NumberSoundServ</servlet-class>
<init-param>
<param-name>basepath</param-name> <param-value>c:/tomcat/webapps/Root/JSPbook/Chap04/sounds
</param-value>
</init-param>
</servlet>
Bill

------------------
author of:
 
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kumar,
Servlet alias means you are calling a servlet with another name of your choice at the URL.
It is always good idea to keep the servlets inside packages and deploy. Assuming you have a LoginServlet kept like this.
com.company.dept.project.LoginServlet.
It need not have this much depth level. What I use is one level depth like MISApp.LoginServlet.
So when we make a request from a url we write like this.
Instead of calling the Servlet with its package name like above everytime, we may choose to have a simple name like this

This means we made an alias for MISApp.LoginServlet as just 'LoginServlet'. For this we have to edit web.xml file and add entries for LoginServlet as Bill stated above. If the servlet container supports Servlet 2.2 API web.xml is the place to write all aliases for servlets.
regds
maha anna
[This message has been edited by maha anna (edited December 09, 2000).]
 
The overall mission is to change the world. When you've done that, then you can read this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic