use of org.glassfish.jersey.server.mvc.MvcFeature in project jersey by jersey.
the class FreemarkerMvcFeature method configure.
@Override
public boolean configure(final FeatureContext context) {
final Configuration config = context.getConfiguration();
if (!config.isRegistered(FreemarkerViewProcessor.class)) {
// Template Processor.
Configuration configuration = injectionManager.getInstance(Configuration.class);
ServletContext servletContext = injectionManager.getInstance(ServletContext.class);
context.register(new FreemarkerViewProcessor(configuration, servletContext, injectionManager::createAndInitialize));
// MvcFeature.
if (!config.isRegistered(MvcFeature.class)) {
context.register(MvcFeature.class);
}
return true;
}
return false;
}
use of org.glassfish.jersey.server.mvc.MvcFeature in project jersey by jersey.
the class MustacheMvcFeature method configure.
@Override
public boolean configure(final FeatureContext context) {
final Configuration config = context.getConfiguration();
if (!config.isRegistered(MustacheTemplateProcessor.class)) {
// Template Processor.
Configuration configuration = injectionManager.getInstance(Configuration.class);
ServletContext servletContext = injectionManager.getInstance(ServletContext.class);
context.register(new MustacheTemplateProcessor(configuration, servletContext, injectionManager::createAndInitialize));
// MvcFeature.
if (!config.isRegistered(MvcFeature.class)) {
context.register(MvcFeature.class);
}
return true;
}
return false;
}
Aggregations