Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

replacement for getServlets()/getServletNames()

Status
Not open for further replies.

lmsasu

Instructor
Jan 28, 2003
6
RO
Hi.

I'd like to find out the servlets running on a server. For versions prior to Java Servlet API 2.0, these methods worked, but now they are deprecated "with no replacement". Could someone give me another ideea concerning this issue?

Thanks,
Lucian.
 
Hallo Lucian,
I think I have some bad news for you.Soon you will have no chance of getting servletnames by that method,because as far as I know this methods will return an empty enumeration on the latest version of JVM.
The reason is security.The methods still reside in order to preserve your classes to be compiled succesfully.[soapbox]

Salih Sipahi
Software Engineer.
City of Istanbul Turkey
s.sipahi@sahinlerholding.com.tr
turkey_clr.gif
 
You could always utilize the init() and destroy() methods of HttpServlet, so that when a Servlet is loaded (ie is running) it writes a message to a file (or somewhere), and when it is destroyed (ie not running) it also appends a message to this file - then you will be able to see what is running and what is not ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top