@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 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/
.
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() |
void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Servlet's service method.
|
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.ServletException
public void init() throws javax.servlet.ServletException
javax.servlet.ServletException
public void service(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.ServletException
java.io.IOException
public 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.ServletException
java.io.IOException
public 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.ServletException
java.io.IOException
public 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.ServletException
java.io.IOException
public 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.ServletException
java.io.IOException
public abstract java.lang.String getPath()
public javax.servlet.ServletConfig getServletConfig()
public boolean requiresAuthorization()
© Copyright SyncRO Soft SRL 2002 - 2016. All rights reserved.