- Notifications
You must be signed in to change notification settings - Fork 6
servlets
James Moger edited this page Nov 20, 2015
·
1 revision
The conf/Servlets.java class is an implicit ServletsModule within your Fathom application and allows you to programatically specify servlets and filters to build URL mappings.
This class does not support @RequireSetting or mode-specific (@DEV, @TEST, & @PROD) annotations, however the same functionality can be achieved using getSettings().isDev(), etc.
!!! Warning "Not Required" You are not required to have this class on your classpath.
YourApp
└── src
└── main
└── java
└── conf
└── Servlets.java
!!! Note
This class depends on the value of the application.package setting. If you have specified an application package then your Servlets class must be ${package}/conf/Servlets.java.
packageconf;
publicclassServletsextendsServletsModule {
@Overrideprotectedvoidsetup() {
// serve all requests to the application context with MyServletserve("/*").with(MyServlet.class);
if (getSettings().isDev()) {
// add an audit filter for the DEV modefilter("/*").through(MyAuditFilter.class);
}
}
}