org.ultrawork.wtk.mc
Class ComponentControllerServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--org.ultrawork.wtk.mc.ComponentControllerServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ComponentControllerServlet
extends javax.servlet.http.HttpServlet

A Servlet responsible for managing components of the org.ultrawork.twk.mc package.

It accepts a Jsp or Servlet that defines the application components. It will define the application components upon the very first request by requesting the resource located under the component-definition-url parameter. If the development-mode parameter is set to true, it will reload the component definition upon every request.

It also accepts the name of a java.util.ResourceBundle which will be made available to internationalizeable components.

Version:
0.2
Author:
Nicolas Bonvin
See Also:
Serialized Form

Field Summary
private static boolean componentDefinitionLoaded
           
private  java.lang.String componentDefinitionUrl
           
private  boolean developmentMode
           
 
Fields inherited from class javax.servlet.http.HttpServlet
HEADER_IFMODSINCE, HEADER_LASTMOD, LSTRING_FILE, lStrings, METHOD_DELETE, METHOD_GET, METHOD_HEAD, METHOD_OPTIONS, METHOD_POST, METHOD_PUT, METHOD_TRACE
 
Fields inherited from class javax.servlet.GenericServlet
config
 
Constructor Summary
ComponentControllerServlet()
           
 
Method Summary
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  void doPost(javax.servlet.http.HttpServletRequest arg0, javax.servlet.http.HttpServletResponse arg1)
           
protected  java.lang.String getComponentDefinitionUrl()
           
 void init(javax.servlet.ServletConfig config)
           
protected  boolean isDevelopmentMode()
           
protected  void loadComponentDefinition(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  java.lang.String removeLeadingSlash(java.lang.String path)
           
protected  boolean shouldLoadComponentDefinitions()
           
protected  void writeComponent(java.lang.String componentName, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
, doDelete, doHead, doOptions, doPut, doTrace, getAllDeclaredMethods, getLastModified, maybeSetLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

componentDefinitionLoaded

private static boolean componentDefinitionLoaded

componentDefinitionUrl

private java.lang.String componentDefinitionUrl

developmentMode

private boolean developmentMode
Constructor Detail

ComponentControllerServlet

public ComponentControllerServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Overrides:
init in class javax.servlet.GenericServlet
See Also:
GenericServlet#init(ServletConfig)

doPost

protected void doPost(javax.servlet.http.HttpServletRequest arg0,
                      javax.servlet.http.HttpServletResponse arg1)
               throws javax.servlet.ServletException,
                      java.io.IOException
Overrides:
doPost in class javax.servlet.http.HttpServlet
See Also:
HttpServlet.doPost(HttpServletRequest, HttpServletResponse)

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     java.io.IOException
Overrides:
doGet in class javax.servlet.http.HttpServlet
See Also:
HttpServlet.doGet(HttpServletRequest, HttpServletResponse)

writeComponent

protected void writeComponent(java.lang.String componentName,
                              javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
                       throws java.io.IOException,
                              javax.servlet.ServletException

loadComponentDefinition

protected void loadComponentDefinition(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response)
                                throws javax.servlet.ServletException

shouldLoadComponentDefinitions

protected boolean shouldLoadComponentDefinitions()

isDevelopmentMode

protected boolean isDevelopmentMode()

removeLeadingSlash

protected java.lang.String removeLeadingSlash(java.lang.String path)

getComponentDefinitionUrl

protected java.lang.String getComponentDefinitionUrl()


Copyright 2002 - ultrawork