public abstract class AbstractServlet
extends jakarta.servlet.http.HttpServlet
Extending this servlet is one way of providing a plugin. The other is to simply direclty implement the servlet interface. In both cases requests to resources with a path of "LABEL/res/*" are automatically handled.
For html (content) requests, the web console automatically renders the header, footer and navigation.
Support for Jakarta servlets requires that the Jakarta Servlet API and the Apache Felix Http Wrappers are available in the runtime.
If you are upgrading from AbstractWebConsolePlugin
there are some changes to be aware of:
getResource(String)
method.renderContent(HttpServletRequest, HttpServletResponse)
method is invoked.Constructor and Description |
---|
AbstractServlet() |
Modifier and Type | Method and Description |
---|---|
void |
renderContent(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.http.HttpServletResponse response)
This method is used to render the main contents of the plugin
|
static void |
setNoCache(jakarta.servlet.http.HttpServletResponse response)
Sets response headers to force the client to not cache the response
sent back.
|
public void renderContent(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, java.io.IOException
request
- The requestresponse
- The responsejakarta.servlet.ServletException
- If an error occursjava.io.IOException
- If writing the response failspublic static final void setNoCache(jakarta.servlet.http.HttpServletResponse response)
This method sets the Cache-Control
, Expires
,
and Pragma
headers.
response
- The response for which to set the cache preventionCopyright © 2010 - 2023 Adobe. All Rights Reserved