Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: update for SLING-1636 (header/footer only for html requests)

...

  • renderContext(HttpServletRequest, HttpServletResponse) – Calls the service(HttpServletRequest, HttpServletResponse) method of the plugin to render the actual contents of the plugin.
  • getLabel() – Returns the value of the felix.webconsole.label service registration property of the plugin.
  • getTitle() – Returns the value of the felix.webconsole.title service registration property of the plugin.
  • getCssReferences() – Returns the values of the felix.webconsole.css service registration property of the plugin.
  • service(ServletRequest, ServletResponse) – If the request method is GET the service(ServletRequest, ServletResponse) method of the AbstractWebConsolePlugin is called which ultimately calls the renderContent service method. For all other requests, the service(ServletRequest, ServletResponse) method of the plugin is called directly to have the plugin handle any non-GET requests directly.

Please note, that sometimes it is not desirable to have the AbstractWebConsolePlugin render the header and footer of the response. For this reason, the AbstractWebConsolePlugin only renders the header and footer if the request to such a wrapped plugin either has no extension or if the extension is .html. For any other extension, e.g. .txt or .json, the header and footer is not rendered and the service method of the plugin is directly called.

It is suggested that plugins extend from the javax.servlet.http.HttpServlet class and implement the appropriate doXxx(HttpServletRequest, HttpServletResponse) methods such as doGet and doPost. In addition, unless non-GET requests are handled through AJAX calls, it is suggested that non-GET requests return a redirect after processing the request.