public class ServletUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getConfigPath(javax.servlet.http.HttpServlet servlet)
Returns the path to the "Content" directory for the OLFS.
|
static java.lang.String |
getConfigPath(javax.servlet.ServletContext sc)
Returns the path to the "Content" directory for the OLFS.
|
static java.lang.String |
getContextPath(javax.servlet.http.HttpServlet servlet)
Returns the path to the web applications "context" directory as defined by the value of the
web appications <initParameter> ContextPath.
|
static java.lang.String |
getContextPath(javax.servlet.ServletContext sc)
Returns the path to the web applications "context" directory as defined by the value of the
web appications <initParameter> ContextPath.
|
static java.lang.String |
getRootPath(javax.servlet.http.HttpServlet servlet) |
static java.lang.String |
getRootPath(javax.servlet.ServletContext sc) |
static java.lang.String |
getSystemPath(javax.servlet.http.HttpServlet servlet,
java.lang.String path) |
static java.lang.String |
getSystemPath(javax.servlet.ServletContext sc,
java.lang.String path) |
static java.lang.String |
probeRequest(javax.servlet.http.HttpServlet servlet,
javax.servlet.http.HttpServletRequest request)
************************************************************************
This is a bit of instrumentation that I kept around to let me look at the
state of the incoming
HttpServletRequest from the client. |
static java.lang.String |
probeServlet(javax.servlet.http.HttpServlet servlet) |
static java.lang.String |
probeServletConfig(javax.servlet.ServletConfig scfg) |
static java.lang.String |
probeServletContext(javax.servlet.ServletContext sc) |
static java.lang.String |
showRequest(javax.servlet.http.HttpServletRequest req,
long reqno)
Writes information about the incomming request to a String.
|
static java.lang.String |
showSession(javax.servlet.http.HttpSession session) |
static java.lang.String |
toString(javax.servlet.http.HttpServlet servlet) |
public static java.lang.String getConfigPath(javax.servlet.http.HttpServlet servlet)
servlet
- The HttpServlet that is running.public static java.lang.String getConfigPath(javax.servlet.ServletContext sc)
sc
- The ServletContext for this servlet that is running.public static java.lang.String getContextPath(javax.servlet.http.HttpServlet servlet)
servlet
- Servlet instance to evaluatepublic static java.lang.String getContextPath(javax.servlet.ServletContext sc)
sc
- ServletContext to evaluatepublic static java.lang.String getSystemPath(javax.servlet.http.HttpServlet servlet, java.lang.String path)
public static java.lang.String getSystemPath(javax.servlet.ServletContext sc, java.lang.String path)
public static java.lang.String getRootPath(javax.servlet.http.HttpServlet servlet)
public static java.lang.String getRootPath(javax.servlet.ServletContext sc)
public static java.lang.String toString(javax.servlet.http.HttpServlet servlet)
public static java.lang.String probeServlet(javax.servlet.http.HttpServlet servlet)
public static java.lang.String probeServletConfig(javax.servlet.ServletConfig scfg)
public static java.lang.String probeServletContext(javax.servlet.ServletContext sc)
public static java.lang.String showRequest(javax.servlet.http.HttpServletRequest req, long reqno)
req
- The current requestreqno
- The request number.public static java.lang.String showSession(javax.servlet.http.HttpSession session)
public static java.lang.String probeRequest(javax.servlet.http.HttpServlet servlet, javax.servlet.http.HttpServletRequest request)
HttpServletRequest
from the client.
This method calls the get*
methods of the request and prints
the results to standard out.servlet
- The Servlet to Proberequest
- The HttpServletRequest
object to probe.