• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Servlet Aliasing

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
No prison can hold Chairface Chippendale. And on a totally different topic ... my stuff:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic