Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SCI implements ServletContainerInitializer {
- @Override
- public void onStartup(Set<Class<?>> arg0, ServletContext arg1)
- throws ServletException {
- arg1.addFilter("myFilter", MyFilter.class).addMappingForUrlPatterns(null, false, "/*");
- }
- }
- public static class MyFilter implements Filter {
- @Override
- public void destroy() { }
- @Override
- public void doFilter(ServletRequest arg0, ServletResponse arg1,
- FilterChain arg2) throws IOException, ServletException {
- if (arg1 instanceof HttpServletResponse) {
- ((HttpServletResponse) arg1).addHeader("Test", "Test");
- }
- arg2.doFilter(arg0, arg1);
- }
- @Override
- public void init(FilterConfig arg0) throws ServletException { }
- }
- test.SCI
- <featureManager>
- <feature>bells-1.0</feature>
- </featureManager>
- <library id="init">
- <file name="path/to/jar"/>
- </library>
- <bell libraryRef="init"/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement