Advertisement
Guest User

Untitled

a guest
May 28th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. @ApplicationPath("/")
  2. public class FrontConfig extends ResourceConfig {
  3.  
  4. @Inject
  5. public FrontConfig(ServiceLocator serviceLocator) {
  6. GuiceBridge.getGuiceBridge().initializeGuiceBridge(serviceLocator);
  7. GuiceIntoHK2Bridge guiceBridge = serviceLocator.getService(GuiceIntoHK2Bridge.class);
  8. guiceBridge.bridgeGuiceInjector(Guice.createInjector(new ServletModule() {
  9. @Override protected void configureServlets() {
  10. }
  11. }));
  12.  
  13. register(FreemarkerFeature.class);
  14. property(FreemarkerFeature.CONFIGURATION_CUSTOMIZER, (ConfigurationCustomizer) configuration -> {
  15. configuration.addAutoImport("layout", "/WEB-INF/ftl/macro/layout.ftl");
  16. });
  17.  
  18. register(ObjectMapperProvider.class);
  19. register(CustomJacksonFeature.class);
  20.  
  21. register(AuthFilter.class);
  22. register(AuthenticationRequiredExceptionMapper.class);
  23.  
  24. packages(Env.getRootPackage() + ".front.resource");
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement