File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

invoking servlets differently

 
ray bond
Ranch Hand
Posts: 111
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
Ajith Kallambella
Sheriff
Posts: 5782
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
maha anna
Ranch Hand
Posts: 1467
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
ray bond
Ranch Hand
Posts: 111
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello there ,
thank you very much maha for your reply , it is working
perfactly fine.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic