Class VIPPatternFilter

java.lang.Object
com.vmware.vipclient.i18n.filters.VIPPatternFilter
All Implemented Interfaces:
javax.servlet.Filter

public class VIPPatternFilter extends Object implements javax.servlet.Filter
This class is specified as a filter in web.xml
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
     
    void
    init(javax.servlet.FilterConfig filterConfig)
    Here will create TranslationMessage instance, but create it requires I18nFactory instance created first, and creation of I18nFactory requires VIPCfg instance.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VIPPatternFilter

      public VIPPatternFilter()
  • Method Details

    • doFilter

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

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

      public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
      Here will create TranslationMessage instance, but create it requires I18nFactory instance created first, and creation of I18nFactory requires VIPCfg instance. Hence you must create VIPCfg instance and I18nFactory instance before this filter initialize, so recommend you create them at your service starts, that is in listener class that implements ServletContextListener, or will throw ServletException. Furthermore when initialize VIPCfg you had better rename your config file to avoid config loading error. You can write it in web.xml as <context-param> to avoid hardcoding the config file in code and make the whole application share the same config.
      Specified by:
      init in interface javax.servlet.Filter
      Parameters:
      filterConfig -
      Throws:
      javax.servlet.ServletException