com.ibm.commerce.context.preview.servlet

Class PreviewFilter

  • java.lang.Object
    • com.ibm.commerce.context.preview.servlet.PreviewFilter
  • All Implemented Interfaces:
    javax.servlet.Filter


    public class PreviewFilter
    extends java.lang.Object
    implements javax.servlet.Filter
    This class defines a servlet filter. It will perform any preprocessing of the request to give it some preview context before it goes through additional processing.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
    • Constructor Summary

      Constructors 
      Constructor and Description
      PreviewFilter()
      This is the default constructor for this class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void destroy()
      This method performs and deinitializes operations when the filter is being shut down.
      void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain filterChain)
      This method performs the preview operation before the request is processed.
      void init(javax.servlet.FilterConfig filterConfiguration)
      This method initializes the preview filter.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PreviewFilter

        public PreviewFilter()
        This is the default constructor for this class. It calls the constructor from the superclass.
    • Method Detail

      • init

        public void init(javax.servlet.FilterConfig filterConfiguration)
                  throws javax.servlet.ServletException
        This method initializes the preview filter. There is no initialization required for this preview filter so no operation is performed.
        Specified by:
        init in interface javax.servlet.Filter
        Parameters:
        filterConfiguration - The filter configuration.
        Throws:
        javax.servlet.ServletException - This is thrown if there is a problem during filter initialization. This will never happen since no initialization steps are required.
        See Also:
        Filter.init(javax.servlet.FilterConfig)
      • doFilter

        public void doFilter(javax.servlet.ServletRequest request,
                             javax.servlet.ServletResponse response,
                             javax.servlet.FilterChain filterChain)
                      throws java.io.IOException,
                             javax.servlet.ServletException
        This method performs the preview operation before the request is processed. This filter sets the request as uncachable so the response will not be cached. It then forwards the request on to the next filter in the filter chain.
        Specified by:
        doFilter in interface javax.servlet.Filter
        Parameters:
        request - The servlet request.
        response - The servlet response.
        filterChain - The filter chain.
        Throws:
        java.io.IOException - This is thrown if a problem occurs when writing the response.
        javax.servlet.ServletException - This is thrown if a problem occurs while handling the request.
        See Also:
        Filter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
      • destroy

        public void destroy()
        This method performs and deinitializes operations when the filter is being shut down. This filter does not require any shutdown clean so no operations are performed.
        Specified by:
        destroy in interface javax.servlet.Filter
        See Also:
        Filter.destroy()