コード例 #1
0
  public static class HelloServlet extends HttpServlet {
    private final JtwigRenderer renderer =
        new JtwigRenderer(EnvironmentConfigurationBuilder.configuration().build());

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
      renderer
          .inlineDispatcherFor("Hello {{ app.request.query.get('one') }}!")
          .render(request, response);
    }
  }
コード例 #2
0
 public void configure(EnvironmentConfigurationBuilder environmentConfigurationBuilder) {
   environmentConfigurationBuilder
       .parameters()
       .add(JSON_MAPPER_PROVIDER, new CompositeJsonMapperProvider(jsonMapperProviders));
 }