----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
Hopefully I making some simple, stupid mistake that someone
will recognize right away, but I can't make this code work:
ServletContext zone = getServletConfig().getServletContext()
Enumeration names = zone.getServletNames();
while (names.hasMoreElements()) {
out.println(zone.getServlet((String)names.nextElement()).getServletInfo
out.println(zone.getServlet((String)names.nextElement()).getServletInfo());
}
getServletNames() returns nothing (that is, the while loop is
never executed). On the other hand, if I replace the while
loop with this:
out.println(zone.getServlet("AValidServletName").getServletInfo());
I get the servlet info I'm looking for.
Can anyone explain why getServletNames() isn't working for me?
Also, in the JSDK 2.0 docs (and its copied in the JServ docs for
the JServContext class), it says this about getServletNames():
Note: This is a dangerous method to call for the following reasons.
When this method is called the state of the servlet may not
be known, and this could cause problems with the server's
servlet state machine.
[...]
Can anyone explain if this is a real danger in JServ, and if so
are there any circumstances under which it is a safe call? All
I'm really trying to do is write a monitoring agent servlet that
will list information about each servlet that is currently loaded.
Is there a safe way to do that?
Thanks,
-Don
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search Archives:
<http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]