Am Dienstag, 13. Januar 2004 15:24 schrieb Michael Coughlan:
> Thanks for the reply Christain.

Never mind :-)

[CLIP!]

> > There already is such a page in the
> > standard Servlet demos...
>
> I'd love to see that. Is that on the Sun site? On the Oreilly site?
> Any links would be appreciated.

The Snoop servlet is part of the 'official' Servlet
demos; shipped with the Oracle iAS and Tomcat,
at the least. Resin ships with an improved JSP-
based version, and you can extend all of these
as you wish. For instance, you can get a long
list of all the Java Runtime properties (as long
as accessing this information not forbidden by
security constraints) by adding this to your
'snoop' JSP:

<table class="form" cellpadding="0" cellspacing="0">
  <tr><th colspan="2">Java Runtime</th></tr>
  <% for (Enumeration spn = System.getProperties().propertyNames();
spn.hasMoreElements() ;) {
     String propertyName  = (String) spn.nextElement();
     String propertyValue = System.getProperty(propertyName); %>
  <tr><td><%= propertyName %></td><td><%= propertyValue %></td></tr>
  <% } %>
</table>

But: a better idea would be to look at the Servlet APIs -
that's exactly what you can get on server side from the
request. Check out getRemoteHost(), getProtocol(),
getHeader() and the like. Unless the client info is not
made available via headers, you may well be doomed
to have a closer look at JavaScript.

HTH,
-- Chris (SCPJ2)

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com

Reply via email to