Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.google.sitebricks;
 
Provides an optional mechanism for users of Sitebricks to supply javax.servlet.Servlet and javax.servlet.Filter implementations using the standard Guice Servlet APIs.

For example:
public Injector getInjector() {
return Guice.createInjector(new SitebricksModule() {

Override:
protected SitebricksServletModule servletModule() { return new SitebricksServletModule() {
Override:
protected void configurePreFilters() { filter("/*").through(MyPreFilter.class); }
Override:
protected void configurePreFilters() { filter("/*").through(MyPostFilter.class); }
Override:
protected void configureCustomServlets() { serve("/foo").with(FooServlet.class); } }; }
Override:
protected void configureSitebricks() { ... } } }
public class SitebricksServletModule extends ServletModule {
  protected final void configureServlets() {
    filter("/*").through(HiddenMethodFilter.class);
    filter("/*").through(SitebricksFilter.class);
  }

  
Provides a mechanism for users of Sitebricks to register their own javax.servlet.Servlet implementations with Guice Servlet via serve and serveRegex.

  protected void configureCustomServlets() {
  }


  
Provides a mechanism for users of Sitebricks to register their own javax.servlet.Filter implementation with Guice Servlet via filter and filterRegex.


Filters declared in this method will execute in the filter chain before the Sitebricks filter invokes.

  protected void configurePreFilters() {
  }

  
Provides a mechanism for users of Sitebricks to register their own javax.servlet.Filter implementation with Guice Servlet via filter and filterRegex.


Filters declared in this method will execute in the filter chain only if Sitebricks determines it will not handle the request.

  protected void configurePostFilters() {
  }
New to GrepCode? Check out our FAQ X