Hi Dave,
Attached is SnoopSerlvet.jsp. If you drop it in your jsp container and
reference the source code you will be able to get the info you are looking
for.
--Abraham
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 11, 2001 1:16 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Returning to called page after loggin on...
>
>
>
>
> In reference to this...how do you refer to the url of the page in
> a custom tag?
>
> Dave
>
>
>
>
> ---------------------- Forwarded by David Hay/Lex/Lexmark on
> 07/11/2001 03:57 PM
> ---------------------------
>
>
> David Hay
> 07/11/2001 01:18 PM
>
> To: [EMAIL PROTECTED],
> [EMAIL PROTECTED]
> cc:
>
> Subject: Returning to called page after loggin on... (Document
> link: David
> Hay)
>
> Hi everyone.
>
> I am placing a tag on each page to check the user is logged on, which, as
> expected, takes them to a login page if they are not.
>
> However, I want to then return them to the page they tried to
> access before
> being asked to log on. Do I need to save the name of the page
> somewhere, or is
> there an easier way?
>
> Cheers,
>
> Dave
>
>
>
>
>
>
Title: Snoop Servlet
|
Snoop Servlet
This servlet returns information about the HTTP request
itself. You can modify this servlet to take this information
and store it elsewhere for your HTTP server records. This
servlet is also useful for debugging.
Servlet Spec Version Implemented
<%= getServletConfig().getServletContext().getMajorVersion() + "." + getServletConfig().getServletContext().getMinorVersion() %>
Requested URL
<%= HttpUtils.getRequestURL(request) %>
Request parameters
<%
Enumeration enum = request.getParameterNames();
while(enum.hasMoreElements()){
String key = (String)enum.nextElement();
String[] paramValues = request.getParameterValues(key);
for(int i=0;i < paramValues.length;i++){
out.println(key + " : " + paramValues[i]);
}
}
%>
Request information
Request Method: <%= request.getMethod() %>
Request URI: <%= request.getRequestURI() %>
Request Protocol: <%= request.getProtocol() %>
Servlet Path: <%= request.getServletPath() %>
Path Info: <%= request.getPathInfo() %>
Path Translated: <%= request.getPathTranslated() %>
Query String: <%= request.getQueryString() %>
Content Length: <%= request.getContentLength() %>
Content Type: <%= request.getContentType() %>
Server Name: <%= request.getServerName() %>
Server Port: <%= request.getServerPort() %>
Remote User: <%= request.getRemoteUser() %>
Remote Address: <%= request.getRemoteAddr() %>
Remote Host: <%= request.getRemoteHost() %>
Authorization Scheme: <%= request.getAuthType() %>
Certificate Information
<%
try {
weblogic.security.X509 certs [] = (weblogic.security.X509 [])
request.getAttribute("javax.net.ssl.peer_certificates");
if (certs != null) {
weblogic.security.JDK11Certificate jdk11cert = new weblogic.security.JDK11Certificate(certs[0]);
%>
Subject Name : <%= jdk11cert.getPrincipal().getName() %>
Issuer Name :<%= jdk11cert.getGuarantor().getName() %>
Certificate Chain Length : <%= certs.length %>
<%
// List the Certificate chain
for (int i=0; i Certificate[<%= i %>] : <%= certs[i].toString() %>
<%
} // end of for loop
%>
<%
}
else // certs==null
{
%>
Not using SSL or client certificate not required.
<%
}
} catch (ClassCastException cce) {
System.out.println(cce.getMessage());
cce.printStackTrace();
}
%>
Request headers
<%
enum = request.getHeaderNames();
while (enum.hasMoreElements()) {
String name = (String)enum.nextElement();
out.println(name + ": " + request.getHeader(name));
}
%>
Copyright © 1999-2000 by BEA Systems, Inc. All Rights Reserved.
|