org.apache.felix.webconsole
Class AbstractWebConsolePlugin

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.apache.felix.webconsole.AbstractWebConsolePlugin
All Implemented Interfaces:
Serializable, Servlet, ServletConfig
Direct Known Subclasses:
BaseWebConsolePlugin, LicenseServlet, RenderBridge, ShellServlet

public abstract class AbstractWebConsolePlugin
extends HttpServlet

See Also:
Serialized Form

Field Summary
static String ATTR_FILEUPLOAD
          The name of the request attribute containig the map of FileItems from the POST request
 
Constructor Summary
AbstractWebConsolePlugin()
           
 
Method Summary
 void activate(BundleContext bundleContext)
           
 void deactivate()
           
protected  void doGet(HttpServletRequest request, HttpServletResponse response)
          Renders the web console page for the request.
protected  void endResponse(PrintWriter pw)
           
protected  BundleContext getBundleContext()
           
abstract  String getLabel()
           
static String getParameter(HttpServletRequest request, String name)
           
 String getServletName()
          Returns the title for this plugin as returned by getTitle()
abstract  String getTitle()
           
protected abstract  void renderContent(HttpServletRequest req, HttpServletResponse res)
           
protected  void renderTopNavigation(HttpServletRequest request, PrintWriter pw)
           
protected  void sendRedirect(HttpServletRequest request, HttpServletResponse response, String redirectUrl)
          Utility method to handle relative redirects.
protected  PrintWriter startResponse(HttpServletRequest request, HttpServletResponse response)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_FILEUPLOAD

public static final String ATTR_FILEUPLOAD
The name of the request attribute containig the map of FileItems from the POST request

See Also:
Constant Field Values
Constructor Detail

AbstractWebConsolePlugin

public AbstractWebConsolePlugin()
Method Detail

getServletName

public String getServletName()
Returns the title for this plugin as returned by getTitle()

Specified by:
getServletName in interface ServletConfig
Overrides:
getServletName in class GenericServlet

doGet

protected void doGet(HttpServletRequest request,
                     HttpServletResponse response)
              throws ServletException,
                     IOException
Renders the web console page for the request. This consist of the following four parts called in order:
  1. startResponse(HttpServletRequest, HttpServletResponse)
  2. renderTopNavigation(HttpServletRequest, PrintWriter)
  3. renderContent(HttpServletRequest, HttpServletResponse)
  4. endResponse(PrintWriter)

Overrides:
doGet in class HttpServlet
Throws:
ServletException
IOException

activate

public void activate(BundleContext bundleContext)

deactivate

public void deactivate()

getTitle

public abstract String getTitle()

getLabel

public abstract String getLabel()

renderContent

protected abstract void renderContent(HttpServletRequest req,
                                      HttpServletResponse res)
                               throws ServletException,
                                      IOException
Throws:
ServletException
IOException

getBundleContext

protected BundleContext getBundleContext()

startResponse

protected PrintWriter startResponse(HttpServletRequest request,
                                    HttpServletResponse response)
                             throws IOException
Throws:
IOException

renderTopNavigation

protected void renderTopNavigation(HttpServletRequest request,
                                   PrintWriter pw)

endResponse

protected void endResponse(PrintWriter pw)

getParameter

public static String getParameter(HttpServletRequest request,
                                  String name)

sendRedirect

protected void sendRedirect(HttpServletRequest request,
                            HttpServletResponse response,
                            String redirectUrl)
                     throws IOException
Utility method to handle relative redirects. Some app servers like web sphere handle relative redirects differently therefore we should make an absolute url before invoking send redirect.

Throws:
IOException


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.