Class PluginServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.jivesoftware.openfire.container.PluginServlet
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public class PluginServlet
extends javax.servlet.http.HttpServlet
The plugin servlet acts as a proxy for web requests (in the admin console)
to plugins. Since plugins can be dynamically loaded and live in a different place
than normal Openfire admin console files, it's not possible to have them
added to the normal Openfire admin console web app directory.
The servlet listens for requests in the form /plugins/[pluginName]/[JSP File]
(e.g. /plugins/foo/example.jsp). It also listens for non JSP requests in the
form like /plugins/[pluginName]/images/*.png|gif,
/plugins/[pluginName]/scripts/*.js|css or
/plugins/[pluginName]/styles/*.css (e.g.
/plugins/foo/images/example.gif).
- Author:
- Matt Tucker
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(javax.servlet.ServletConfig config) static StringregisterServlet(PluginManager pluginManager, Plugin plugin, javax.servlet.GenericServlet servlet, String relativeUrl) Registers a live servlet for a plugin programmatically, does not initialize the servlet.static voidregisterServlets(PluginManager manager, Plugin plugin, File webXML) Registers all JSP page servlets for a plugin.voidservice(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) static javax.servlet.GenericServletunregisterServlet(Plugin plugin, String url) Unregister a live servlet for a plugin programmatically.static voidunregisterServlets(File webXML) Unregisters all JSP page servlets for a plugin.Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, serviceMethods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Field Details
-
ALLOW_LOCAL_FILE_READING
-
-
Constructor Details
-
PluginServlet
public PluginServlet()
-
-
Method Details
-
init
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException - Specified by:
initin interfacejavax.servlet.Servlet- Overrides:
initin classjavax.servlet.GenericServlet- Throws:
javax.servlet.ServletException
-
service
public void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) - Overrides:
servicein classjavax.servlet.http.HttpServlet
-
registerServlets
Registers all JSP page servlets for a plugin.- Parameters:
manager- the plugin manager.plugin- the plugin.webXML- the web.xml file containing JSP page names to servlet class file mappings.
-
unregisterServlets
Unregisters all JSP page servlets for a plugin.- Parameters:
webXML- the web.xml file containing JSP page names to servlet class file mappings.
-
registerServlet
public static String registerServlet(PluginManager pluginManager, Plugin plugin, javax.servlet.GenericServlet servlet, String relativeUrl) throws javax.servlet.ServletException Registers a live servlet for a plugin programmatically, does not initialize the servlet.- Parameters:
pluginManager- the plugin managerplugin- the owner of the servletservlet- the servlet.relativeUrl- the relative url where the servlet should be bound- Returns:
- the effective url that can be used to initialize the servlet
- Throws:
javax.servlet.ServletException- if the servlet is null
-
unregisterServlet
public static javax.servlet.GenericServlet unregisterServlet(Plugin plugin, String url) throws javax.servlet.ServletException Unregister a live servlet for a plugin programmatically. Does not call the servlet destroy method.- Parameters:
plugin- the owner of the servleturl- the relative url where servlet has been bound- Returns:
- the unregistered servlet, so that it can be destroyed
- Throws:
javax.servlet.ServletException- if the URL is missing
-