本文整理汇总了Java中io.dropwizard.views.ViewRenderer类的典型用法代码示例。如果您正苦于以下问题:Java ViewRenderer类的具体用法?Java ViewRenderer怎么用?Java ViewRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ViewRenderer类属于io.dropwizard.views包,在下文中一共展示了ViewRenderer类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import io.dropwizard.views.ViewRenderer; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<SamConfiguration> bootstrap) {
final List<ViewRenderer> renderers = Arrays.asList(new MarkdownViewRenderer(), new HtmlViewRenderer(), new MustacheViewRenderer());
bootstrap.addBundle(new ViewBundle<SamConfiguration>(renderers));
bootstrap.addBundle(new AssetsBundle("/static", "/static", "index.mustache", "static"));
bootstrap.addBundle(new AssetsBundle("/docs", "/docs", "index.html", "docs"));
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(
bootstrap.getConfigurationSourceProvider(),
new EnvironmentVariableSubstitutor()
)
);
bootstrap.addCommand(new OAuth2Command());
bootstrap.addCommand(new CreateDatabaseCommand(this));
bootstrap.addCommand(new AddTestdataCommand(this));
}
示例2: initialize
import io.dropwizard.views.ViewRenderer; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<ExampleBootstrapConfigration> bootstrap) {
//
bootstrap.addBundle(new AssetsBundle("/templates/css","/css",null,"css"));
bootstrap.addBundle(new AssetsBundle("/templates/js","/js",null,"js"));
bootstrap.addBundle(new AssetsBundle("/templates/fonts","/fonts",null,"fonts"));
ImmutableSet<ViewRenderer> renderes= ImmutableSet.of((ViewRenderer)new ThymeleafViewRenderer());
bootstrap.addBundle(new ViewBundle(renderes));
}
示例3: configure
import io.dropwizard.views.ViewRenderer; //导入依赖的package包/类
@Override
protected AppDescriptor configure() {
final DefaultResourceConfig config = new DefaultResourceConfig();
final ViewRenderer renderer = new TrimouViewRenderer.Builder().build();
config.getSingletons().add(new ViewMessageBodyWriter(new MetricRegistry(), ImmutableList.of(renderer)));
config.getSingletons().add(new TestResource());
return new LowLevelAppDescriptor.Builder(config).build();
}
示例4: initialize
import io.dropwizard.views.ViewRenderer; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<BookConfiguration> b) {
b.addBundle(new ViewBundle(ImmutableList.<ViewRenderer>of(new FreemarkerViewRenderer())));
}
示例5: initialize
import io.dropwizard.views.ViewRenderer; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<ExampleConfiguration> bootstrap) {
ImmutableSet<ViewRenderer> renderes= ImmutableSet.of((ViewRenderer)new ThymeleafViewRenderer());
bootstrap.addBundle(new ViewBundle(renderes));
}