@API(type=EXTENDABLE,
src=PUBLIC)
public abstract class WebappServletPluginExtension
extends java.lang.Object
implements PluginExtension
This abstract should be extended in order to create a webapp plugin servlet extension.
To register the servlet you just have to declare an extension of type "WebappServlet" in the plugin's plugin.xml file.
For example:
<extension type="WebappServlet" class="com.domain.example.WebappServletPluginExtensionImpl"/>
The webapp will register it automatically. The Servlet will
and map it to an URL which is computed from the path returned by the getPath() method.
For example, if the webapp is available at http://example.com/xml-editor/ and
the getPath() method returns mypath, this servlet handles requests for the
urls starting with: http://example.com/xml-editor/plugins-dispatcher/mypath/.
Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.
| Modifier and Type | Field and Description |
|---|---|
protected javax.servlet.ServletConfig |
config
The servlet configuration.
|
| Constructor and Description |
|---|
WebappServletPluginExtension() |
| Modifier and Type | Method and Description |
|---|---|
void |
doDelete(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Servlet's doDelete method.
|
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Servlet's doGet method.
|
void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Servlet's doPost method.
|
void |
doPut(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Servlet's doPut method.
|
abstract java.lang.String |
getPath()
Should be implemented to return the relative path handled by this plugin.
|
javax.servlet.ServletConfig |
getServletConfig() |
void |
init()
Servlet's init() method.
|
void |
init(javax.servlet.ServletConfig config)
Init function that stores the config.
|
boolean |
requiresAuthorization() |
public void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
init() method instead. If you decide to override this one,
call the super implementation.config - The configuration.javax.servlet.ServletExceptionpublic void init()
throws javax.servlet.ServletException
javax.servlet.ServletExceptionpublic void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
java.io.IOException
req - the request.resp - the response.javax.servlet.ServletExceptionjava.io.IOExceptionpublic void doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
java.io.IOException
req - the request.resp - the response.javax.servlet.ServletExceptionjava.io.IOExceptionpublic void doPut(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
java.io.IOException
req - the request.resp - the response.javax.servlet.ServletExceptionjava.io.IOExceptionpublic void doDelete(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
java.io.IOException
req - the request.resp - the response.javax.servlet.ServletExceptionjava.io.IOExceptionpublic abstract java.lang.String getPath()
public javax.servlet.ServletConfig getServletConfig()
public boolean requiresAuthorization()
© Copyright SyncRO Soft SRL 2002 - 2015. All rights reserved.