corelib.services.web.webapplications
Class ControllerServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by corelib.services.web.webapplications.ControllerServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
MockedHttpServlet

public class ControllerServlet
extends javax.servlet.http.HttpServlet

This controller receives all requests on web pages or web services. The controller's responsibility is to transfer the execution on the correct class, depending on the requested resource.

Since:
0.1
Author:
Dominique Liard
See Also:
Serialized Form

Constructor Summary
ControllerServlet()
          Ellipse controller servlet constructor.
 
Method Summary
static WebApplication getApplication()
          Returns the WebApplication instance associated to this application.
static javax.servlet.ServletContext getHttpContext()
          Returns the ServletContext associated to this web application.
static ControllerServlet getInstance()
          Returns the Ellipse controller for this application.
static javax.servlet.http.HttpServletRequest getRequestForCurrentThread()
          Returns the HTTP servlet request associated to the calling thread.
static javax.servlet.http.HttpServletResponse getResponseForCurrentThread()
          Returns the HTTP servlet response associated to the calling thread.
static javax.servlet.http.HttpSession getSessionForCurrentThread()
          Returns the HTTP session associated to the calling thread.
 void init()
           
 void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, 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
 

Constructor Detail

ControllerServlet

public ControllerServlet()
                  throws java.lang.Exception
Ellipse controller servlet constructor. Do not invoke explicitly this constructor.

Throws:
java.lang.Exception - Thrown if DOM builder factory cannot be instanciated.
Method Detail

getRequestForCurrentThread

public static javax.servlet.http.HttpServletRequest getRequestForCurrentThread()
Returns the HTTP servlet request associated to the calling thread.

Returns:
The corresponding HTTP servlet request.

getResponseForCurrentThread

public static javax.servlet.http.HttpServletResponse getResponseForCurrentThread()
Returns the HTTP servlet response associated to the calling thread.

Returns:
The corresponding HTTP servlet response.

getSessionForCurrentThread

public static javax.servlet.http.HttpSession getSessionForCurrentThread()
Returns the HTTP session associated to the calling thread.

Returns:
The corresponding HTTP session.

getHttpContext

public static javax.servlet.ServletContext getHttpContext()
Returns the ServletContext associated to this web application.

Returns:
The applicative servlet context.

getApplication

public static WebApplication getApplication()
Returns the WebApplication instance associated to this application.

Returns:
The applicative WebApplication instance.

getInstance

public static ControllerServlet getInstance()
Returns the Ellipse controller for this application.

Returns:
The Ellipse controller.

init

public void init()
Overrides:
init in class javax.servlet.GenericServlet

service

public void service(javax.servlet.http.HttpServletRequest request,
                    javax.servlet.http.HttpServletResponse response)
             throws java.io.IOException,
                    javax.servlet.ServletException
Overrides:
service in class javax.servlet.http.HttpServlet
Throws:
java.io.IOException
javax.servlet.ServletException


CAUTION: Ellipse is proposed to you in BETA version to allow evaluation of this framework. Infini Software is released from any responsibility for the use of Ellipse Framework.

Copyright 2012 Infini Software - All Rights Reserved.