<%@page contentType="text/html" pageEncoding="UTF-8"%> <%@page import="java.util.*"%> SPNEGO test

Hello World!

auth type: <%=request.getAuthType()%>

remote user: <%=request.getRemoteUser() %>

principal: <%=request.getUserPrincipal() %>

name: <%= (request.getUserPrincipal()!=null)?request.getUserPrincipal().getName():"NO PRINCIPAL" %>

CGI Variables:

JSP-equivalents to CGI variables:
AUTH_TYPE: <%= request.getAuthType() %>
CONTENT_LENGTH: <%= request.getContentLength() %>
CONTENT_TYPE: <%= request.getContentType() %>
PATH_INFO: <%= request.getPathInfo() %>
PATH_TRANSLATED: <%= request.getPathTranslated() %>
QUERY_STRING: <%= request.getQueryString() %>
REMOTE_ADDR: <%= request.getRemoteAddr() %>
REMOTE_HOST: <%= request.getRemoteHost() %>
REMOTE_USER: <%= request.getRemoteUser() %>
REQUEST_METHOD: <%= request.getMethod() %>
SCRIPT_NAME: <%= request.getServletPath() %>
SERVER_NAME: <%= request.getServerName() %>
SERVER_PORT: <%= request.getServerPort() %>
SERVER_PROTOCOL: <%= request.getProtocol() %>
SERVER_SOFTWARE: <%= getServletContext().getServerInfo() %>

Other parameters I'm often interested in:

Request URI: <%= request.getRequestURI() %>
Request URL: <%= request.getRequestURL() %>
Request Context Path: <%= request.getContextPath() %>
Real Path: <%= getServletContext().getRealPath("/") %>

Request Headers:

<% java.util.Enumeration e = request.getHeaderNames(); while (e.hasMoreElements()) { String name = (String)e.nextElement(); String value = request.getHeader(name); %> <%= name %>: <%= value %>
<% } %>

System.getenv()

<% Map env = System.getenv(); for (String key : env.keySet() ) {%> <% }%>
Name Value
<%=key%> <%=env.get(key)%>