public class PluginServlet
extends javax.servlet.http.HttpServlet
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).
JSP files must be compiled and available via the plugin's class loader. The mapping between JSP name and servlet class files is defined in [pluginName]/web/web.xml. Typically, this file is auto-generated by the JSP compiler when packaging the plugin. Alternatively, if development mode is enabled for the plugin then the the JSP file will be dynamically compiled using JSPC.| Modifier and Type | Field and Description |
|---|---|
static String |
PLUGINS_WEBROOT |
| Constructor and Description |
|---|
PluginServlet() |
| Modifier and Type | Method and Description |
|---|---|
void |
init(javax.servlet.ServletConfig config) |
static String |
registerServlet(PluginManager pluginManager,
Plugin plugin,
javax.servlet.GenericServlet servlet,
String relativeUrl)
Registers a live servlet for a plugin programmatically, does not
initialize the servlet.
|
static void |
registerServlets(PluginManager manager,
Plugin plugin,
File webXML)
Registers all JSP page servlets for a plugin.
|
void |
service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
static javax.servlet.GenericServlet |
unregisterServlet(Plugin plugin,
String url)
Unregister a live servlet for a plugin programmatically.
|
static void |
unregisterServlets(File webXML)
Unregisters all JSP page servlets for a plugin.
|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, servicepublic static final String PLUGINS_WEBROOT
public void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
init in interface javax.servlet.Servletinit in class javax.servlet.GenericServletjavax.servlet.ServletExceptionpublic void service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
service in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionpublic static void registerServlets(PluginManager manager, Plugin plugin, File webXML)
manager - the plugin manager.plugin - the plugin.webXML - the web.xml file containing JSP page names to servlet class file
mappings.public static void unregisterServlets(File webXML)
webXML - the web.xml file containing JSP page names to servlet class file
mappings.public static String registerServlet(PluginManager pluginManager, Plugin plugin, javax.servlet.GenericServlet servlet, String relativeUrl) throws javax.servlet.ServletException
pluginManager - the plugin managerplugin - the owner of the servletservlet - the servlet.relativeUrl - the relative url where the servlet should be boundjavax.servlet.ServletExceptionpublic static javax.servlet.GenericServlet unregisterServlet(Plugin plugin, String url) throws javax.servlet.ServletException
plugin - the owner of the servleturl - the relative url where servlet has been boundjavax.servlet.ServletExceptionCopyright © 2003-2008 Jive Software.