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); } }
public void configure(EnvironmentConfigurationBuilder environmentConfigurationBuilder) { environmentConfigurationBuilder .parameters() .add(JSON_MAPPER_PROVIDER, new CompositeJsonMapperProvider(jsonMapperProviders)); }