hello there, I am using tomcat to run servlets , to invoke servlets in tomcat , in browser we type "http://server:80/servlet/ServletName" , but how can we invoke servlets like "http://server:80/servlet/directoryname/ServletName" , where dirctoryname is the name of directory in which ServletName.class resides. I know by setting classpath we can put servlets class in other direcotories then web-inf , but how to invoke servlet by putting servlet class in a certain directory and then invoking that servlet using that directory name in url. e.g. "http://server:80/servlet/directoryname/ServletName"
[This message has been edited by ray bond (edited January 04, 2001).]
Joined: Mar 17, 2000
I think you will have to change the Servlet mapping for the particular Servlet in the Web.XML file to make it point to the specific directory.
I guess you'll need to restart the servlet engine. Hope that helps! Ajith
Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Joined: Jan 31, 2000
Ray, We need to define 2 params in Web.xml file Define 1. <servlet> Name </servlet> 2. Use 'Name' in <servlet-mapping> </servlet-mapping>. I just cut and paste an example came with Tomcat 3.1 [This message has been edited by maha anna (edited January 04, 2001).]
Joined: Oct 11, 2000
hello there , thank you very much maha for your reply , it is working perfactly fine.