Package org.exoplatform.container.web
Class AbstractHttpServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.exoplatform.container.web.AbstractHttpServlet
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public abstract class AbstractHttpServlet
extends javax.servlet.http.HttpServlet
Created by The eXo Platform SAS
Author : Nicolas Filotto
nicolas.filotto@exoplatform.com
29 sept. 2009
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected javax.servlet.ServletConfigThe filter configurationprotected StringThe Servlet context name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterInit(javax.servlet.ServletConfig config) Allows sub-classes to initializeprotected final ExoContainerjavax.servlet.ServletContextfinal voidinit(javax.servlet.ServletConfig config) protected voidonPortalEnvironmentError(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) Allow the sub classed to execute a task when the portal environment could not be set because no related portal container could be foundprotected voidonService(ExoContainer container, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) Allow the sub classes to execute a task when the methodserviceis calledprotected booleanIndicates if it requires that a full portal environment must be setfinal voidservice(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, serviceMethods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, getServletName, init, log, log
-
Field Details
-
config
protected javax.servlet.ServletConfig configThe filter configuration -
servletContextName
The Servlet context name
-
-
Constructor Details
-
AbstractHttpServlet
public AbstractHttpServlet()
-
-
Method Details
-
init
public final void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException - Specified by:
initin interfacejavax.servlet.Servlet- Overrides:
initin classjavax.servlet.GenericServlet- Throws:
javax.servlet.ServletException
-
afterInit
protected void afterInit(javax.servlet.ServletConfig config) throws javax.servlet.ServletException Allows sub-classes to initialize- Parameters:
config- the current servlet configuration- Throws:
javax.servlet.ServletException
-
service
public final void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, IOException - Overrides:
servicein classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException- See Also:
-
HttpServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
-
requirePortalEnvironment
protected boolean requirePortalEnvironment()Indicates if it requires that a full portal environment must be set- Returns:
trueif it requires the portal environmentfalseotherwise.
-
onService
protected void onService(ExoContainer container, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, IOException Allow the sub classes to execute a task when the methodserviceis called- Parameters:
container- the eXo containerreq- theHttpServletRequestres- theHttpServletResponse- Throws:
javax.servlet.ServletExceptionIOException
-
onPortalEnvironmentError
protected void onPortalEnvironmentError(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, IOException Allow the sub classed to execute a task when the portal environment could not be set because no related portal container could be found- Parameters:
req- theHttpServletRequestres- theHttpServletResponse- Throws:
javax.servlet.ServletExceptionIOException
-
getContainer
- Returns:
- Gives the
ExoContainerthat fits best with the current context
-
getServletContext
public javax.servlet.ServletContext getServletContext()- Specified by:
getServletContextin interfacejavax.servlet.ServletConfig- Overrides:
getServletContextin classjavax.servlet.GenericServlet- Returns:
- the current
ServletContext
-