21 Aug 2002 mglazer   » (Journeyer)

Reading the CGI Variables in JSP:

String AUTH_TYPE	 = request.getAuthType();
Int CONTENT_LENGTH	 = String.valueOf(request.getContentLength());
String CONTENT_TYPE	 = request.getContentType();
String DOCUMENT_ROOT	 = getServletContext().getRealPath("/");
String PATH_INFO	 = request.getPathInfo();
String PATH_TRANSLATED	 = request.getPathTranslated();
String QUERY_STRING	 = request.getQueryString();
String REMOTE_ADDR	 = request.getRemoteAddr();
String REMOTE_HOST	 = request.getRemoteHost();
String REMOTE_USER	 = request.getRemoteUser();
String REQUEST_METHOD	 = request.getMethod();
String SCRIPT_NAME	 = request.getServletPath();
String SERVER_NAME	 = request.getServerName();
Int SERVER_PORT	 = String.valueOf(request.getServerPort());
String SERVER_PROTOCOL	 = request.getProtocol();
String SERVER_SOFTWARE	 = getServletContext().getServerInfo();

Using the above in a JSP page:

<%=request.getServletPath()%>

Ot the XML equivalent of:

<jsp:expression>
request.getServletPath()
</jsp:expression>

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!