Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Servlets and the fly likes Alias of a servlet ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Alias of a servlet ?" Watch "Alias of a servlet ?" New topic
Author

Alias of a servlet ?

Vishakha Ahuja
Ranch Hand

Joined: Sep 13, 2000
Posts: 191
Hello, I read that a server knows a servlet by the alias name.
On Allaire Jrun, How do I define alias for the servlet: Specifically,
1)If my servlet class file (Eg. HelloServlet.class) resides in this directory
c:\Program Files\Allaire\JRun\servers\default\default-app\web-inf\classes, then what should be my fully qualified servlet class name ? can servlet name and display name be the same ?
2)What should be my address in the web-browser for running this alias servlet ?
Currently, I run it with this address:
http://localhost:8100/servlet/HelloServlet
I can run with class name, but just don't know how to refer it with an alias name ?
Please help.
Thankyou,
Vishakha
Kiran Kumar
Ranch Hand

Joined: May 18, 2001
Posts: 107
in the def-app directory there is a web.xml file which u have to edit to access ur servlet. like the following
servlet-name snoop
description snoop servlet
servlet-class SnoopServlet
servlet-mapping
servlet-name snoop
url-pattern /servlet/snoop2/*
servlet-mapping


Thanks<br /> <br />Kiran <br /> <br />SCEA, SCJP 1.4,<br /> <br />"First they ignore u, then they laugh at u, then they fight u, <br />then u will win<br /> <br />Mahatma Gandhi"
Vishakha Ahuja
Ranch Hand

Joined: Sep 13, 2000
Posts: 191
Thanks for the reply.
However JRun gives a GUI to make these changes and they are autimatically reflected in the xml.
I tried changing this xml file, and my default-server wouldn't start "error: exited abnormally, check event log file"
When I restored the xml to its original state, server started alright. Now, I'm back to square one.
 
wood burning stoves
 
subject: Alias of a servlet ?
 
Similar Threads
JRUN exits abnormally
9-1-1 emergency call. Please Help!!!!!!!!
Allaire JRun: How to make alias of servlet
Error 404- not found
Cookies not persistent ... how can it be?