Top Description Fields Constructors Methods
org.apache.catalina.manager.host

public final Class HTMLHostManagerServlet

extends HostManagerServlet
Class Inheritance
Imports
java.io.IOException, .PrintWriter, .StringWriter, java.net.URLEncoder, java.text.MessageFormat, java.util.Arrays, .SortedSet, .TreeSet, jakarta.servlet.ServletException, jakarta.servlet.http.HttpServletRequest, .HttpServletResponse, org.apache.catalina.Container, .Host, org.apache.catalina.util.ServerInfo, org.apache.tomcat.util.res.StringManager, org.apache.tomcat.util.security.Escape

Servlet that enables remote management of the virtual hosts deployed on the server. 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 HostManagerServlet and this Servlet is that this Servlet prints out an HTML interface which makes it easier to administrate.

However if you use a software that parses the output of HostManagerServlet you won't be able to upgrade to this Servlet since the output are not in the same format as from HostManagerServlet

Authors
Bip Thelin, Malcolm Edgar, Glenn L. Nielsen, Peter Rossbach
See Also
org.apache.catalina.manager.ManagerServlet

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final long
Inherited from org.apache.catalina.manager.host.HostManagerServlet:
contextdebugengineinstalledHostsmwrapper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected String

Returns:

output
add
(HttpServletRequest
The Servlet request
request
,
String
Host name
name
,
StringManager
StringManager for the client's locale
smClient
)

Add a host using the specified parameters.

public void
doGet(HttpServletRequest
The servlet request we are processing
request
,
HttpServletResponse
The servlet response we are creating
response
)

Overrides org.apache.catalina.manager.host.HostManagerServlet.doGet.

Process a GET request for the specified resource.

public void
doPost(HttpServletRequest
The servlet request we are processing
request
,
HttpServletResponse
The servlet response we are creating
response
)

Overrides jakarta.servlet.http.HttpServlet.doPost.

Process a POST request for the specified resource.

public void
list(HttpServletRequest
The request
request
,
HttpServletResponse
The response
response
,
String
a message to display
message
,
StringManager
StringManager for the client's locale
smClient
)

Render an HTML list of the currently active Contexts in our virtual host, and memory and server status information.

protected String

Returns:

output
persist
(StringManager
i18n resources localized for the client
smClient
)

Persist the current configuration to server.xml.

protected String

Returns:

output
remove
(String
Host name
name
,
StringManager
StringManager for the client's locale
smClient
)

Remove the specified host.

protected String

Returns:

output
start
(String
Host name
name
,
StringManager
StringManager for the client's locale
smClient
)

Start the host with the specified name.

protected String

Returns:

output
stop
(String
Host name
name
,
StringManager
StringManager for the client's locale
smClient
)

Stop the host with the specified name.

Inherited from org.apache.catalina.manager.host.HostManagerServlet:
addaddbooleanParameterdestroygetConfigBasegetWrapperinitlistpersistremovesetWrapperstartstop

Field Detail

ADD_SECTION_BOOLEANback to summary
private static final String ADD_SECTION_BOOLEAN
ADD_SECTION_ENDback to summary
private static final String ADD_SECTION_END
ADD_SECTION_STARTback to summary
private static final String ADD_SECTION_START
HOSTS_HEADER_SECTIONback to summary
private static final String HOSTS_HEADER_SECTION
HOSTS_ROW_BUTTON_SECTIONback to summary
private static final String HOSTS_ROW_BUTTON_SECTION
HOSTS_ROW_DETAILS_SECTIONback to summary
private static final String HOSTS_ROW_DETAILS_SECTION
MANAGER_HOST_ROW_BUTTON_SECTIONback to summary
private static final String MANAGER_HOST_ROW_BUTTON_SECTION
PERSIST_SECTIONback to summary
private static final String PERSIST_SECTION
serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.apache.catalina.manager.host.HostManagerServlet.serialVersionUID.

Constructor Detail

HTMLHostManagerServletback to summary
public HTMLHostManagerServlet()

Method Detail

addback to summary
protected String add(HttpServletRequest request, String name, StringManager smClient)

Add a host using the specified parameters.

Parameters
request:HttpServletRequest

The Servlet request

name:String

Host name

smClient:StringManager

StringManager for the client's locale

Returns:String

output

doGetback to summary
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException

Overrides org.apache.catalina.manager.host.HostManagerServlet.doGet.

Process a GET request for the specified resource.

Parameters
request:HttpServletRequest

The servlet request we are processing

response:HttpServletResponse

The servlet response we are creating

Annotations
@Override
Exceptions
IOException:
if an input/output error occurs
ServletException:
if a servlet-specified error occurs
doPostback to summary
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException

Overrides jakarta.servlet.http.HttpServlet.doPost.

Process a POST request for the specified resource.

Parameters
request:HttpServletRequest

The servlet request we are processing

response:HttpServletResponse

The servlet response we are creating

Annotations
@Override
Exceptions
ServletException:
if a servlet-specified error occurs
IOException:
if an input/output error occurs
listback to summary
public void list(HttpServletRequest request, HttpServletResponse response, String message, StringManager smClient) throws IOException

Render an HTML list of the currently active Contexts in our virtual host, and memory and server status information.

Parameters
request:HttpServletRequest

The request

response:HttpServletResponse

The response

message:String

a message to display

smClient:StringManager

StringManager for the client's locale

Exceptions
IOException:
An IO error occurred
persistback to summary
protected String persist(StringManager smClient)

Persist the current configuration to server.xml.

Parameters
smClient:StringManager

i18n resources localized for the client

Returns:String

output

removeback to summary
protected String remove(String name, StringManager smClient)

Remove the specified host.

Parameters
name:String

Host name

smClient:StringManager

StringManager for the client's locale

Returns:String

output

startback to summary
protected String start(String name, StringManager smClient)

Start the host with the specified name.

Parameters
name:String

Host name

smClient:StringManager

StringManager for the client's locale

Returns:String

output

stopback to summary
protected String stop(String name, StringManager smClient)

Stop the host with the specified name.

Parameters
name:String

Host name

smClient:StringManager

StringManager for the client's locale

Returns:String

output