Exemple #1
0
  private void addSessionFilter(Context ctx) {
    FilterDef filterDef = new FilterDef();
    filterDef.setFilterName(HibernateSessionFilter.class.getSimpleName());
    filterDef.setFilter(new HibernateSessionFilter());
    filterDef.setAsyncSupported("true");
    ctx.addFilterDef(filterDef);

    FilterMap filterMap = new FilterMap();
    filterMap.setFilterName(HibernateSessionFilter.class.getSimpleName());
    filterMap.addURLPattern("/api/*");
    ctx.addFilterMap(filterMap);
  }
Exemple #2
0
  private void addCharacterEncodingFilter(Context ctx) {
    FilterDef filterDef = new FilterDef();
    filterDef.setFilterName(CharsetFilter.class.getSimpleName());
    filterDef.setFilter(new CharsetFilter());
    filterDef.setAsyncSupported("true");
    ctx.addFilterDef(filterDef);

    FilterMap filterMap = new FilterMap();
    filterMap.setFilterName(CharsetFilter.class.getSimpleName());
    filterMap.addURLPattern("/*");
    ctx.addFilterMap(filterMap);
  }