Class MicroWebFilter

java.lang.Object
com.zfabrik.util.microweb.MicroWebFilter
All Implemented Interfaces:
javax.servlet.Filter

public class MicroWebFilter extends Object implements javax.servlet.Filter
All this filter does is to check wether an action should be executed for this request. If so, it will call the action. The outcome of that action determines where to go next. Actions are determined by the path information of the request URL. It will be cut into segments and actions will be applied according to a longest match pattern. The relevant URL can be obtained via MicroWebUtil#getRelevantPath(HttpServletRequest). Actions that require relative addressing in turn should send a redirect in case of a missing trailing "/"
  • Constructor Details

    • MicroWebFilter

      public MicroWebFilter()
  • Method Details

    • destroy

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

      public static javax.servlet.http.HttpServletRequest getCurrentRequest()
      get the current request
    • getLanguageContextPath

      public static String getLanguageContextPath(javax.servlet.http.HttpServletRequest request, String lang)
      construct a new locale specific url
    • doFilter

      public void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
      Specified by:
      doFilter in interface javax.servlet.Filter
      Throws:
      IOException
      javax.servlet.ServletException
    • init

      public void init(javax.servlet.FilterConfig cfg) throws javax.servlet.ServletException
      Specified by:
      init in interface javax.servlet.Filter
      Throws:
      javax.servlet.ServletException