org.apache.catalina.manager
public final class HTMLManagerServlet extends ManagerServlet
The difference between the ManagerServlet
and this
Servlet is that this Servlet prints out a HTML interface which
makes it easier to administrate.
However if you use a software that parses the output of
ManagerServlet
you won't be able to upgrade
to this Servlet since the output are not in the
same format ar from ManagerServlet
ManagerServlet
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected static java.lang.String |
APPLICATION_ERROR |
protected static java.lang.String |
APPLICATION_MESSAGE |
protected java.lang.String |
sessionDetailJspPath |
protected java.lang.String |
sessionsListJspPath |
protected static URLEncoder |
URL_ENCODER |
appBase, configBase, context, contextDescriptors, debug, deployed, global, host, mBeanServer, oname, sm, versioned, wrapper
Constructor and Description |
---|
HTMLManagerServlet() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
deployInternal(java.lang.String config,
java.lang.String path,
java.lang.String war)
Deploy an application for the specified path from the specified
web application archive.
|
protected void |
displaySessionDetailPage(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
java.lang.String path,
java.lang.String sessionId) |
protected void |
displaySessionsListPage(java.lang.String path,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Process a GET request for the specified resource.
|
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Process a POST request for the specified resource.
|
protected void |
doSessions(java.lang.String path,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
protected java.lang.String |
expireSessions(java.lang.String path,
javax.servlet.http.HttpServletRequest req)
Extract the expiration request parameter
|
protected java.util.Comparator |
getComparator(java.lang.String sortBy) |
java.lang.String |
getServletInfo()
Returns information about the servlet, such as
author, version, and copyright.
|
protected Session |
getSessionForPathAndId(java.lang.String path,
java.lang.String id) |
protected Session[] |
getSessionsForPath(java.lang.String path) |
void |
init()
Initialize this servlet.
|
int |
invalidateSessions(java.lang.String path,
java.lang.String[] sessionIds)
Invalidate HttpSessions
|
void |
list(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String message)
Render a HTML list of the currently active Contexts in our virtual host,
and memory and server status information.
|
protected java.lang.String |
reload(java.lang.String path)
Reload the web application at the specified context path.
|
boolean |
removeSessionAttribute(java.lang.String path,
java.lang.String sessionId,
java.lang.String attributeName)
Removes an attribute from an HttpSession
|
java.lang.String |
sessions(java.lang.String path)
Display session information and invoke list.
|
java.lang.String |
sessions(java.lang.String path,
int idle)
Display session information and invoke list.
|
int |
setSessionMaxInactiveInterval(java.lang.String path,
java.lang.String sessionId,
int maxInactiveInterval)
Sets the maximum inactive interval (session timeout) an HttpSession
|
java.lang.String |
start(java.lang.String path)
Start the web application at the specified context path.
|
protected java.lang.String |
stop(java.lang.String path)
Stop the web application at the specified context path.
|
protected java.lang.String |
undeploy(java.lang.String path)
Undeploy the web application at the specified context path.
|
addServiced, check, copy, copyInternal, deploy, deploy, deploy, destroy, doPut, expireSessions, getAppBase, getConfigFile, getDocBase, getWrapper, isDeployed, isServiced, list, printResources, reload, removeServiced, resources, roles, save, serverinfo, sessions, sessions, setWrapper, start, stop, undeploy, undeployDir, uploadWar
doDelete, doHead, doOptions, doTrace, getLastModified, service, service
protected static final URLEncoder URL_ENCODER
protected static final java.lang.String APPLICATION_MESSAGE
protected static final java.lang.String APPLICATION_ERROR
protected java.lang.String sessionsListJspPath
protected java.lang.String sessionDetailJspPath
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException
doGet
in class ManagerServlet
request
- The servlet request we are processingresponse
- The servlet response we are creatingjava.io.IOException
- if an input/output error occursjavax.servlet.ServletException
- if a servlet-specified error occursServletResponse.setContentType(java.lang.String)
public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException
doPost
in class javax.servlet.http.HttpServlet
request
- The servlet request we are processingresponse
- The servlet response we are creatingjava.io.IOException
- if an input/output error occursjavax.servlet.ServletException
- if a servlet-specified error occursServletOutputStream
,
ServletResponse.setContentType(java.lang.String)
protected java.lang.String deployInternal(java.lang.String config, java.lang.String path, java.lang.String war)
config
- URL of the context configuration file to be deployedpath
- Context path of the application to be deployedwar
- URL of the web application archive to be deployedpublic void list(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String message) throws java.io.IOException
request
- The requestresponse
- The responsemessage
- a message to displayjava.io.IOException
protected java.lang.String reload(java.lang.String path)
path
- Context path of the application to be restartedManagerServlet.reload(PrintWriter, String)
protected java.lang.String undeploy(java.lang.String path)
path
- Context path of the application to be undeploydManagerServlet.undeploy(PrintWriter, String)
public java.lang.String sessions(java.lang.String path, int idle)
path
- Context path of the application to list session informationidle
- Expire all sessions with idle time ≥ idle for this contextManagerServlet.sessions(PrintWriter, String, int)
public java.lang.String sessions(java.lang.String path)
path
- Context path of the application to list session informationManagerServlet.sessions(PrintWriter, String)
public java.lang.String start(java.lang.String path)
path
- Context path of the application to be startedManagerServlet.start(PrintWriter, String)
protected java.lang.String stop(java.lang.String path)
path
- Context path of the application to be stoppedManagerServlet.stop(PrintWriter, String)
public java.lang.String getServletInfo()
javax.servlet.GenericServlet
Servlet.getServletInfo()
.getServletInfo
in interface javax.servlet.Servlet
getServletInfo
in class javax.servlet.GenericServlet
Servlet.getServletInfo()
public void init() throws javax.servlet.ServletException
ManagerServlet
init
in class ManagerServlet
javax.servlet.ServletException
- if an exception occurs that
interrupts the servlet's
normal operationGenericServlet.init()
protected java.lang.String expireSessions(java.lang.String path, javax.servlet.http.HttpServletRequest req)
path
- req
- protected void doSessions(java.lang.String path, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
req
- resp
- javax.servlet.ServletException
java.io.IOException
protected Session[] getSessionsForPath(java.lang.String path)
protected Session getSessionForPathAndId(java.lang.String path, java.lang.String id) throws java.io.IOException
java.io.IOException
protected void displaySessionsListPage(java.lang.String path, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
req
- resp
- javax.servlet.ServletException
java.io.IOException
protected void displaySessionDetailPage(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, java.lang.String path, java.lang.String sessionId) throws javax.servlet.ServletException, java.io.IOException
req
- resp
- javax.servlet.ServletException
java.io.IOException
public int invalidateSessions(java.lang.String path, java.lang.String[] sessionIds) throws java.io.IOException
sessionIds
- java.io.IOException
public boolean removeSessionAttribute(java.lang.String path, java.lang.String sessionId, java.lang.String attributeName) throws java.io.IOException
sessionId
- attributeName
- java.io.IOException
public int setSessionMaxInactiveInterval(java.lang.String path, java.lang.String sessionId, int maxInactiveInterval) throws java.io.IOException
sessionId
- maxInactiveInterval
- in secondsjava.io.IOException
protected java.util.Comparator getComparator(java.lang.String sortBy)
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.