Class StaticResourceFilter

  • All Implemented Interfaces:
    javax.servlet.Filter

    public class StaticResourceFilter
    extends java.lang.Object
    implements javax.servlet.Filter
    Filter which allows us to bypass all of the spring filters for requests to a given path. This is a simple servlet filter. It is intended to be used to serve static resources from the web application. I can be used early in the filter chain to bypass any spring setup or hybris session setup for the static resources.
    • Constructor Detail

      • StaticResourceFilter

        public StaticResourceFilter()
    • Method Detail

      • getDefaultRequestDispatcher

        protected javax.servlet.RequestDispatcher getDefaultRequestDispatcher()
      • init

        public void init​(javax.servlet.FilterConfig filterConfig)
                  throws javax.servlet.ServletException
        Specified by:
        init in interface javax.servlet.Filter
        Throws:
        javax.servlet.ServletException
      • destroy

        public void destroy()
        Specified by:
        destroy in interface javax.servlet.Filter
      • doFilter

        public void doFilter​(javax.servlet.ServletRequest request,
                             javax.servlet.ServletResponse response,
                             javax.servlet.FilterChain chain)
                      throws java.io.IOException,
                             javax.servlet.ServletException
        Specified by:
        doFilter in interface javax.servlet.Filter
        Throws:
        java.io.IOException
        javax.servlet.ServletException
      • readConfiguredHeaderParamsAndWriteToResponse

        protected void readConfiguredHeaderParamsAndWriteToResponse​(javax.servlet.http.HttpServletResponse httpResponse)
                                                             throws java.io.UnsupportedEncodingException
        Reads the defined http header parameters from the properties into the map and writes to httpResponse. And also register a config change listener to get the properties changes during runtime.
        Throws:
        java.io.UnsupportedEncodingException
      • addHeaderParamsFromConfig

        protected void addHeaderParamsFromConfig​(ConfigIntf config)