com.acsinet_solutions.cetia4.controller.rest
Class RestServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.acsinet_solutions.cetia4.controller.rest.AbstractRestServlet
              extended by com.acsinet_solutions.cetia4.controller.rest.RestServlet
All Implemented Interfaces:
AttributeKeys, ControllerConstants, RestModule, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
MainServlet, Topics10Servlet, Topics11Servlet, Topics12Servlet, Topics13Servlet, Topics14Servlet, Topics15Servlet, Topics16Servlet, Topics1Servlet, Topics2Servlet, Topics3Servlet, Topics4Servlet, Topics5Servlet, Topics6Servlet, Topics7Servlet, Topics8Servlet, Topics9Servlet

public abstract class RestServlet
extends AbstractRestServlet
implements RestModule

This class implements a REST based servlet that may be used as a superclass for modules that will implement REST modules themselves inheriting the current class. Modules implemented this way are tied to the servlet API, but are very easy to setup and use ( see the tutorial for more examples about this ).

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.acsinet_solutions.cetia4.controller.ControllerConstants
_METHOD_PARAM, _PAGE_PARAM, _ROOT_PARAM, DEFAULT_VIEW, ERROR_URL, ERROR_VIEW, LOAD_CANCEL, LOAD_CURRENT, LOAD_DEFAULT, LOAD_ERROR, LOAD_PREVIOUS
 
Fields inherited from interface com.acsinet_solutions.cetia4.controller.AttributeKeys
_BUNDLE_KEY, _CONFIGURATION_KEY, _DEFAULT_CONTROLLER_KEY, _FORM_ACTION_KEY, _FORM_ATTRIBUTE_KEY, _LOCALE_KEY, _MESSAGE_KEY, _NAVIGATION_FLOW_KEY, _PORTAL_PATH_KEY, _RENDER_PARAMETERS_KEY, _SERVICE_LOCATOR_KEY, _SESSION_KEY, _SYSTEM_EXCEPTION_KEY, _VALIDATION_EXCEPTION_KEY
 
Constructor Summary
RestServlet()
           
 
Method Summary
 java.lang.String getModuleName()
          In servlets, the module name is the servlet name, so conventions in web.xml are important.
 int getNestedIndex()
          Get the nested index of available path-info params between this module and the previous one.
 java.util.List<RestModule> getNestedModules()
          Get the not-null maybe empty list of nested modules inside this instance.
 RestModule getParentModule()
          Get the parent module; servlets have no parent module and return null; other components always return not null.
protected  RestModule getRestModule()
          This is a factory abstract template method that will be overriden by subclasses to provide the Root Rest module that will be attended by the current instance.
 RestModule getRootModule()
          A servlet is always a root module
protected  void nest(java.lang.Class<? extends RestModuleSupport> c)
          Add a nested rest module that will be dynamically enhanced.
protected  void nest(RestModule module)
          Add a nested rest module.
 
Methods inherited from class com.acsinet_solutions.cetia4.controller.rest.AbstractRestServlet
doDelete, doGet, doPost, doPut, getConfiguration, getLocator, getLogger, getUserSessionManager, init
 
Methods inherited from class javax.servlet.http.HttpServlet
doHead, doOptions, doTrace, getLastModified, 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, toString, wait, wait, wait
 
Methods inherited from interface com.acsinet_solutions.cetia4.controller.rest.RestModule
getConfiguration, getLocator, getLogger
 

Constructor Detail

RestServlet

public RestServlet()
Method Detail

nest

protected final void nest(RestModule module)
Add a nested rest module.


nest

protected final void nest(java.lang.Class<? extends RestModuleSupport> c)
Add a nested rest module that will be dynamically enhanced. TODO: Check when this could be called. Create appropriate hook method.


getNestedIndex

public final int getNestedIndex()
Description copied from interface: RestModule
Get the nested index of available path-info params between this module and the previous one. This method is irrelevant for servlets, and must be nonnegative for other components.

Specified by:
getNestedIndex in interface RestModule

getNestedModules

public final java.util.List<RestModule> getNestedModules()
Description copied from interface: RestModule
Get the not-null maybe empty list of nested modules inside this instance.

Specified by:
getNestedModules in interface RestModule

getParentModule

public final RestModule getParentModule()
Description copied from interface: RestModule
Get the parent module; servlets have no parent module and return null; other components always return not null.

Specified by:
getParentModule in interface RestModule

getRootModule

public final RestModule getRootModule()
A servlet is always a root module

Specified by:
getRootModule in interface RestModule

getModuleName

public final java.lang.String getModuleName()
In servlets, the module name is the servlet name, so conventions in web.xml are important.

Specified by:
getModuleName in interface RestModule

getRestModule

protected final RestModule getRestModule()
Description copied from class: AbstractRestServlet
This is a factory abstract template method that will be overriden by subclasses to provide the Root Rest module that will be attended by the current instance. This will be called just once during servlet initialization.

Specified by:
getRestModule in class AbstractRestServlet