This servlet examines the value returned by getPathInfo() and related query parameters to determine what
action is being requested. The following actions and parameters (starting after the servlet path) are supported:
host-name attribute indicates the name of the new host. The host-aliases
attribute is a comma separated list of the host alias names. The manager attribute is a boolean value
indicating if the webapp manager will be installed in the newly created host (optional, false by default).host-name attribute indicates the name
of the host.host-name#host-aliases.Note
- Attempting to stop or remove the host containing this servlet itself will not succeed. Therefore, this servlet should generally be deployed in a separate virtual host.
The following servlet initialization parameters are recognized:
| Modifier and Type | Field and Description |
|---|---|
| protected transient Context | context
The Context container associated with our web application. |
| protected int | debug
The debugging detail level for this servlet. |
| protected transient Engine | engine
The associated engine. |
| protected transient Host | installedHost
The associated host. |
| private static final long | |
| protected static final StringManager | sm
The string manager for this package. |
| protected transient Wrapper | wrapper
The Wrapper container associated with this servlet. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | add(HttpServletRequest
The request request, PrintWriter The output writer writer, String The host name name, boolean Flag value htmlMode, StringManager StringManager for the client's locale smClient)Add host with the given parameters. |
| protected synchronized void | add(PrintWriter
Writer to render results to writer, String host name name, String comma separated alias list aliases, String application base for the host appBase, boolean should the manager webapp be deployed to the new host ? manager, boolean Flag value autoDeploy, boolean Flag value deployOnStartup, boolean Flag value deployXML, boolean Flag value unpackWARs, boolean Flag value copyXML, StringManager StringManager for the client's locale smClient)Add a host using the specified parameters. |
| protected boolean | Returns: the boolean value for the parameterThe Servlet request request, String The parameter name parameter, boolean Default value theDefault, boolean Flag value htmlMode)Extract boolean value from checkbox with default. |
| public void | destroy()
Overrides jakarta. Implements jakarta. Finalize this servlet. |
| public void | doGet(HttpServletRequest
The servlet request we are processing request, HttpServletResponse The servlet response we are creating response)Overrides jakarta. Process a GET request for the specified resource. |
| protected File | |
| public Wrapper | getWrapper()
Implements org. Return the Wrapper with which we are associated. |
| public void | init()
Overrides jakarta. A convenience method which can be overridden so that there's no need to call |
| protected void | list(PrintWriter
Writer to render to writer, StringManager StringManager for the client's locale smClient)Render a list of the currently active Contexts in our virtual host. |
| protected void | persist(PrintWriter
Writer to render to writer, StringManager i18n resources localized for the client smClient)Persist the current configuration to server.xml. |
| protected synchronized void | remove(PrintWriter
Writer to render results to writer, String host name name, StringManager StringManager for the client's locale smClient)Remove the specified host. |
| public void | setWrapper(Wrapper
The new wrapper wrapper)Implements org. Set the Wrapper with which we are associated. |
| protected void | start(PrintWriter
Writer to render to writer, String Host name name, StringManager StringManager for the client's locale smClient)Start the host with the specified name. |
| protected void | stop(PrintWriter
Writer to render to writer, String Host name name, StringManager StringManager for the client's locale smClient)Stop the host with the specified name. |
| context | back to summary |
|---|---|
| protected transient Context context The Context container associated with our web application. | |
| debug | back to summary |
|---|---|
| protected int debug The debugging detail level for this servlet. | |
| engine | back to summary |
|---|---|
| protected transient Engine engine The associated engine. | |
| installedHost | back to summary |
|---|---|
| protected transient Host installedHost The associated host. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| sm | back to summary |
|---|---|
| protected static final StringManager sm The string manager for this package. | |
| wrapper | back to summary |
|---|---|
| protected transient Wrapper wrapper The Wrapper container associated with this servlet. | |
| HostManagerServlet | back to summary |
|---|---|
| public HostManagerServlet() | |
| add | back to summary |
|---|---|
| protected void add(HttpServletRequest request, PrintWriter writer, String name, boolean htmlMode, StringManager smClient) Add host with the given parameters.
| |
| add | back to summary |
|---|---|
| protected synchronized void add(PrintWriter writer, String name, String aliases, String appBase, boolean manager, boolean autoDeploy, boolean deployOnStartup, boolean deployXML, boolean unpackWARs, boolean copyXML, StringManager smClient) Add a host using the specified parameters.
| |
| booleanParameter | back to summary |
|---|---|
| protected boolean booleanParameter(HttpServletRequest request, String parameter, boolean theDefault, boolean htmlMode) Extract boolean value from checkbox with default.
| |
| destroy | back to summary |
|---|---|
| public void destroy() Overrides jakarta. Implements jakarta. Finalize this servlet.
| |
| doGet | back to summary |
|---|---|
| public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException Overrides jakarta. Process a GET request for the specified resource.
| |
| getConfigBase | back to summary |
|---|---|
| protected File getConfigBase(String hostName) Get config base. | |
| getWrapper | back to summary |
|---|---|
| public Wrapper getWrapper() Implements org. Return the Wrapper with which we are associated.
| |
| init | back to summary |
|---|---|
| public void init() throws ServletException Overrides jakarta. Doc from jakarta. A convenience method which can be overridden so that there's no need to call
Instead of overriding
| |
| list | back to summary |
|---|---|
| protected void list(PrintWriter writer, StringManager smClient) Render a list of the currently active Contexts in our virtual host.
| |
| persist | back to summary |
|---|---|
| protected void persist(PrintWriter writer, StringManager smClient) Persist the current configuration to server.xml.
| |
| remove | back to summary |
|---|---|
| protected synchronized void remove(PrintWriter writer, String name, StringManager smClient) Remove the specified host.
| |
| setWrapper | back to summary |
|---|---|
| public void setWrapper(Wrapper wrapper) Implements org. Set the Wrapper with which we are associated. | |
| start | back to summary |
|---|---|
| protected void start(PrintWriter writer, String name, StringManager smClient) Start the host with the specified name.
| |
| stop | back to summary |
|---|---|
| protected void stop(PrintWriter writer, String name, StringManager smClient) Stop the host with the specified name.
| |