|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet org.apache.catalina.manager.ManagerServlet org.apache.catalina.manager.HTMLManagerServlet
public final class HTMLManagerServlet
Servlet that enables remote management of the web applications deployed within the same virtual host as this web application is. Normally, this functionality will be protected by a security constraint in the web application deployment descriptor. However, this requirement can be relaxed during testing.
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 FormField Summary | |
---|---|
protected static String |
APPLICATION_ERROR
|
protected static String |
APPLICATION_MESSAGE
|
protected static String |
sessionDetailJspPath
|
protected static String |
sessionsListJspPath
|
protected static URLEncoder |
URL_ENCODER
|
Fields inherited from class org.apache.catalina.manager.ManagerServlet |
---|
appBase, configBase, context, contextDescriptors, debug, deployed, global, host, mBeanServer, oname, sm, versioned, wrapper |
Constructor Summary | |
---|---|
HTMLManagerServlet()
|
Method Summary | |
---|---|
protected String |
deployInternal(String config,
ContextName cn,
String war,
StringManager smClient)
Deploy an application for the specified path from the specified web application archive. |
protected void |
displaySessionDetailPage(HttpServletRequest req,
HttpServletResponse resp,
ContextName cn,
String sessionId,
StringManager smClient)
|
protected void |
displaySessionsListPage(ContextName cn,
HttpServletRequest req,
HttpServletResponse resp,
StringManager smClient)
|
void |
doGet(HttpServletRequest request,
HttpServletResponse response)
Process a GET request for the specified resource. |
void |
doPost(HttpServletRequest request,
HttpServletResponse response)
Process a POST request for the specified resource. |
protected void |
doSessions(ContextName cn,
HttpServletRequest req,
HttpServletResponse resp,
StringManager smClient)
|
protected String |
expireSessions(ContextName cn,
HttpServletRequest req,
StringManager smClient)
Extract the expiration request parameter |
protected String |
findleaks(StringManager smClient)
Find potential memory leaks caused by web application reload. |
protected Comparator<Session> |
getComparator(String sortBy)
|
String |
getServletInfo()
Returns information about the servlet, such as author, version, and copyright. |
protected Session |
getSessionForNameAndId(ContextName cn,
String id,
StringManager smClient)
|
protected List<Session> |
getSessionsForName(ContextName cn,
StringManager smClient)
|
void |
init()
Initialize this servlet. |
protected int |
invalidateSessions(ContextName cn,
String[] sessionIds,
StringManager smClient)
Invalidate HttpSessions |
protected void |
list(HttpServletRequest request,
HttpServletResponse response,
String message,
StringManager smClient)
Render a HTML list of the currently active Contexts in our virtual host, and memory and server status information. |
protected String |
reload(ContextName cn,
StringManager smClient)
Reload the web application at the specified context path. |
protected boolean |
removeSessionAttribute(ContextName cn,
String sessionId,
String attributeName,
StringManager smClient)
Removes an attribute from an HttpSession |
protected String |
sessions(ContextName cn,
int idle,
StringManager smClient)
Display session information and invoke list. |
protected String |
start(ContextName cn,
StringManager smClient)
Start the web application at the specified context path. |
protected String |
stop(ContextName cn,
StringManager smClient)
Stop the web application at the specified context path. |
protected String |
undeploy(ContextName cn,
StringManager smClient)
Undeploy the web application at the specified context path. |
protected String |
upload(HttpServletRequest request,
StringManager smClient)
|
Methods inherited from class org.apache.catalina.manager.ManagerServlet |
---|
addServiced, check, copy, copyInternal, deploy, deploy, deploy, destroy, doPut, expireSessions, findleaks, getAppBase, getStringManager, getWrapper, isDeployed, isServiced, list, printResources, reload, removeServiced, resources, save, serverinfo, sessions, sessions, setWrapper, start, stop, undeploy, undeployDir, uploadWar, validateContextName |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doHead, doOptions, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final URLEncoder URL_ENCODER
protected static final String APPLICATION_MESSAGE
protected static final String APPLICATION_ERROR
protected static final String sessionsListJspPath
protected static final String sessionDetailJspPath
Constructor Detail |
---|
public HTMLManagerServlet()
Method Detail |
---|
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
doGet
in class ManagerServlet
request
- The servlet request we are processingresponse
- The servlet response we are creating
IOException
- if an input/output error occurs
ServletException
- if a servlet-specified error occursServletResponse.setContentType(java.lang.String)
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
doPost
in class HttpServlet
request
- The servlet request we are processingresponse
- The servlet response we are creating
IOException
- if an input/output error occurs
ServletException
- if a servlet-specified error occursServletOutputStream
,
ServletResponse.setContentType(java.lang.String)
protected String upload(HttpServletRequest request, StringManager smClient) throws IOException, ServletException
IOException
ServletException
protected String deployInternal(String config, ContextName cn, String war, StringManager smClient)
config
- URL of the context configuration file to be deployedcn
- Name of the application to be deployedwar
- URL of the web application archive to be deployed
protected void list(HttpServletRequest request, HttpServletResponse response, String message, StringManager smClient) throws IOException
request
- The requestresponse
- The responsemessage
- a message to display
IOException
protected String reload(ContextName cn, StringManager smClient)
cn
- Name of the application to be restartedsmClient
- StringManager for the client's locale
ManagerServlet.reload(PrintWriter, ContextName, StringManager)
protected String undeploy(ContextName cn, StringManager smClient)
cn
- Name of the application to be undeployedsmClient
- StringManager for the client's locale
ManagerServlet.undeploy(PrintWriter, ContextName, StringManager)
protected String sessions(ContextName cn, int idle, StringManager smClient)
cn
- Name of the application to list session informationidle
- Expire all sessions with idle time ≥ idle for this contextsmClient
- StringManager for the client's locale
ManagerServlet.sessions(PrintWriter, ContextName, int,
StringManager)
protected String start(ContextName cn, StringManager smClient)
cn
- Name of the application to be startedsmClient
- StringManager for the client's locale
ManagerServlet.start(PrintWriter, ContextName, StringManager)
protected String stop(ContextName cn, StringManager smClient)
cn
- Name of the application to be stoppedsmClient
- StringManager for the client's locale
ManagerServlet.stop(PrintWriter, ContextName, StringManager)
protected String findleaks(StringManager smClient)
smClient
- StringManager for the client's locale
ManagerServlet.findleaks(boolean, PrintWriter, StringManager)
public String getServletInfo()
javax.servlet.GenericServlet
Servlet.getServletInfo()
.
getServletInfo
in interface Servlet
getServletInfo
in class GenericServlet
Servlet.getServletInfo()
public void init() throws ServletException
ManagerServlet
init
in class ManagerServlet
ServletException
- if an exception occurs that interrupts the servlet's
normal operationGenericServlet.init()
protected String expireSessions(ContextName cn, HttpServletRequest req, StringManager smClient)
cn
- Name of the application from which to expire sessionsreq
- smClient
- StringManager for the client's localeprotected void doSessions(ContextName cn, HttpServletRequest req, HttpServletResponse resp, StringManager smClient) throws ServletException, IOException
req
- resp
- smClient
- StringManager for the client's locale
ServletException
IOException
protected List<Session> getSessionsForName(ContextName cn, StringManager smClient)
protected Session getSessionForNameAndId(ContextName cn, String id, StringManager smClient)
protected void displaySessionsListPage(ContextName cn, HttpServletRequest req, HttpServletResponse resp, StringManager smClient) throws ServletException, IOException
cn
- Name of the application for which the sessions will be listedreq
- resp
- smClient
- StringManager for the client's locale
ServletException
IOException
protected void displaySessionDetailPage(HttpServletRequest req, HttpServletResponse resp, ContextName cn, String sessionId, StringManager smClient) throws ServletException, IOException
req
- resp
- smClient
- StringManager for the client's locale
ServletException
IOException
protected int invalidateSessions(ContextName cn, String[] sessionIds, StringManager smClient) throws IOException
cn
- Name of the application for which sessions are to be
invalidatedsessionIds
- smClient
- StringManager for the client's locale
IOException
protected boolean removeSessionAttribute(ContextName cn, String sessionId, String attributeName, StringManager smClient) throws IOException
cn
- Name of the application hosting the session from which the
attribute is to be removedsessionId
- attributeName
- smClient
- StringManager for the client's locale
IOException
protected Comparator<Session> getComparator(String sortBy)
|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |