Interface IServletContext

All Superinterfaces:
com.ibm.websphere.servlet.context.ExtendedServletContext, com.ibm.websphere.servlet.context.IBMServletContext, jakarta.servlet.ServletContext

public interface IServletContext extends com.ibm.websphere.servlet.context.IBMServletContext
This is an extension to IBMServletContext which can be used to
  • Field Summary

    Fields inherited from interface jakarta.servlet.ServletContext

    ORDERED_LIBS, TEMPDIR
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addFeature(com.ibm.websphere.servlet.container.WebContainer.Feature feature)
    Used to indicate that a Feature is enabled for this context.
    void
    Adds a lifecycle event listener to this context.
    void
    Adds a filter against a specified servlet config into this context
    void
    Adds a filter against a specified mapping into this context
    void
    Adds a target against a specified mapping into this context
    void
     
    boolean
     
    Creates a IFilterConfig object for this context
    Convenience method that creates an IServletWrapper given the servlet config.
    void
    finishEnvSetup(boolean transactional)
    Called by components leveraging the webcontainer to tear down the environment that was setup by a previous call to startEnvSetup(); (1) Namespace - to enable namespace lookups (2) Setup the classloader on the thread to be that of the WebApp.
    Returns the classLoader that this context used to load its resources
     
    jakarta.servlet.ServletContext
    Called by components utilizing IServletContext (ie session) that provide access to a ServletContext object to applications.
    Returns the web app filter manager associated with this context.
    Returns the target that matches (according to the rules under servlet mappings in the servlet spec.) the given mapping.
    com.ibm.wsspi.adaptable.module.Container
     
    getResourcePaths(String path, boolean searchMetaInf)
     
     
    Returns the configuration object associated with this context
     
    boolean
     
    boolean
    isFeatureEnabled(com.ibm.websphere.servlet.container.WebContainer.Feature feature)
     
    boolean
    Returns whether or not filters are defined with this context.
    boolean
     
    void
    Removes an existing listener from this context's list of listeners.
    void
    Replaces the target for the specified mapping in this context
    void
    startEnvSetup(boolean transactional)
    Called by components leveraging the webcontainer to set up the environments necessary (1) Namespace - to enable namespace lookups (2) Setup the classloader on the thread to be that of the WebApp.
    Returns an iterator of all the targets currently loaded (not necessarily initialized) by this context.

    Methods inherited from interface com.ibm.websphere.servlet.context.ExtendedServletContext

    addMappingFilter, getAsyncRequestDispatcher, getDynamicServletRegistrations, getFilterConfig

    Methods inherited from interface com.ibm.websphere.servlet.context.IBMServletContext

    addDynamicServlet, addHttpSessionListener, fireSessionAttributeAdded, fireSessionAttributeRemoved, fireSessionAttributeReplaced, fireSessionCreated, fireSessionDestroyed, getContextPath, getSessionTimeout, isSessionTimeoutSet, loadServlet, removeDynamicServlet, sendError

    Methods inherited from interface jakarta.servlet.ServletContext

    addFilter, addFilter, addFilter, addListener, addListener, addListener, addServlet, addServlet, addServlet, createFilter, createListener, createServlet, declareRoles, getAttribute, getAttributeNames, getContext, getDefaultSessionTrackingModes, getEffectiveMajorVersion, getEffectiveMinorVersion, getEffectiveSessionTrackingModes, getFilterRegistration, getFilterRegistrations, getInitParameter, getInitParameterNames, getJspConfigDescriptor, getMajorVersion, getMimeType, getMinorVersion, getNamedDispatcher, getRealPath, getRequestDispatcher, getResource, getResourceAsStream, getResourcePaths, getServerInfo, getServlet, getServletContextName, getServletNames, getServletRegistration, getServletRegistrations, getServlets, getSessionCookieConfig, log, log, log, removeAttribute, setAttribute, setInitParameter, setSessionTrackingModes
  • Method Details

    • addLifecycleListener

      void addLifecycleListener(EventListener eventListener)
      Adds a lifecycle event listener to this context. The listener can be any of the standard listeners mandated by the Servlet 2.4 specification.
      Parameters:
      eventListener -
    • removeLifeCycleListener

      void removeLifeCycleListener(EventListener eventListener)
      Removes an existing listener from this context's list of listeners. NOTE: Listeners of the type HttpSessionListener && HttpSessionIdListener currently have no way of being removed.
      Parameters:
      eventListener -
    • getWebAppConfig

      WebAppConfig getWebAppConfig()
      Returns the configuration object associated with this context
      Returns:
    • getFilterManager

      WebAppFilterManager getFilterManager()
      Returns the web app filter manager associated with this context.
      Returns:
    • isFiltersDefined

      boolean isFiltersDefined()
      Returns whether or not filters are defined with this context.
      Returns:
    • createServletWrapper

      IServletWrapper createServletWrapper(IServletConfig sconfig) throws Exception
      Convenience method that creates an IServletWrapper given the servlet config.
      Parameters:
      sconfig -
      Returns:
      Throws:
      Exception
    • targets

      Iterator targets()
      Returns an iterator of all the targets currently loaded (not necessarily initialized) by this context. The target objects are all RequestProcessors, and may be either IServletWrappers or ExtensionProcessors
      Returns:
    • getMappingTarget

      RequestProcessor getMappingTarget(String mapping)
      Returns the target that matches (according to the rules under servlet mappings in the servlet spec.) the given mapping.
      Parameters:
      mapping -
      Returns:
    • addMappingTarget

      void addMappingTarget(String mapping, RequestProcessor target) throws Exception
      Adds a target against a specified mapping into this context
      Parameters:
      mapping -
      target -
      Throws:
      Exception
    • containsTargetMapping

      boolean containsTargetMapping(String mapping)
    • replaceMappingTarget

      void replaceMappingTarget(String mapping, RequestProcessor target) throws Exception
      Replaces the target for the specified mapping in this context
      Parameters:
      mapping -
      target -
      Throws:
      Exception
    • createFilterConfig

      IFilterConfig createFilterConfig(String id)
      Creates a IFilterConfig object for this context
      Parameters:
      id -
      Returns:
    • addMappingFilter

      void addMappingFilter(String mapping, IFilterConfig config)
      Adds a filter against a specified mapping into this context
      Parameters:
      mapping -
      config -
    • addMappingFilter

      void addMappingFilter(IServletConfig sConfig, IFilterConfig config)
      Adds a filter against a specified servlet config into this context
      Parameters:
      sConfig -
      config -
    • getClassLoader

      ClassLoader getClassLoader()
      Returns the classLoader that this context used to load its resources
      Specified by:
      getClassLoader in interface jakarta.servlet.ServletContext
      Returns:
    • startEnvSetup

      void startEnvSetup(boolean transactional) throws Exception
      Called by components leveraging the webcontainer to set up the environments necessary (1) Namespace - to enable namespace lookups (2) Setup the classloader on the thread to be that of the WebApp. (3) Depending on the transactional parameter passed, setup transaction related environment
      Parameters:
      transactional -
      Throws:
      Exception
    • finishEnvSetup

      void finishEnvSetup(boolean transactional) throws Exception
      Called by components leveraging the webcontainer to tear down the environment that was setup by a previous call to startEnvSetup(); (1) Namespace - to enable namespace lookups (2) Setup the classloader on the thread to be that of the WebApp. (3) Depending on the transactional parameter passed, setup transaction related environment
      Parameters:
      transactional -
      Throws:
      Exception
    • addFeature

      void addFeature(com.ibm.websphere.servlet.container.WebContainer.Feature feature)
      Used to indicate that a Feature is enabled for this context.
      Parameters:
      feature -
    • isFeatureEnabled

      boolean isFeatureEnabled(com.ibm.websphere.servlet.container.WebContainer.Feature feature)
    • getFacade

      jakarta.servlet.ServletContext getFacade()
      Called by components utilizing IServletContext (ie session) that provide access to a ServletContext object to applications. Since IServletContext provides access to webcontainer internals, components are allowed to only expose the facade object to applications and not the enhanced WebContainer ServletContext implementation IServletContext.
      Returns:
    • getCommonTempDirectory

      String getCommonTempDirectory()
    • isCachingEnabled

      boolean isCachingEnabled()
    • getWebAppInvocationCollaborators

      IInvocationCollaborator[] getWebAppInvocationCollaborators()
    • addToStartWeightList

      void addToStartWeightList(IServletConfig sc)
    • isInitialized

      boolean isInitialized()
    • getWebAppCmd

      WebComponentMetaData getWebAppCmd()
    • getResourcePaths

      Set getResourcePaths(String path, boolean searchMetaInf)
    • getModuleContainer

      com.ibm.wsspi.adaptable.module.Container getModuleContainer()