This week's book giveaway is in the OCAJP forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
The moose likes Servlets and the fly likes Question on Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Question on Servlets" Watch "Question on Servlets" New topic
Author

Question on Servlets

Vineela Devi
Ranch Hand

Joined: Dec 20, 2003
Posts: 191
Hi,

Can anyone please tell me whether there is anyway to find the no of Servlets in a given web application?

Regards,
Vineela
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42952
    
  73
Look at the web.xml file?
Vineela Devi
Ranch Hand

Joined: Dec 20, 2003
Posts: 191
without looking at web.xml
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42952
    
  73
Why not?

You can also look at the source code or the class files and count how many implement HttpServlet.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

I don't think there is anything in the spec for doing this.

Check with the documentation for the container you're using to see what they offer. I know that Tomcat will show you the deployed servlets if you fire up the HTML Manager app and go to Server Status -> Complete Server Status you'll see a list of all the servlets deployed in each application along with some data for each of them.

Mind if I ask why you would want to know this?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Vineela Devi
Ranch Hand

Joined: Dec 20, 2003
Posts: 191
One of my friends was asked this question in an interview.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question on Servlets