Advertisement
andersonalmada

Untitled

Jul 1st, 2022
736
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  2.     TemplateEngine templateEngine = (TemplateEngine) getServletContext()
  3.         .getAttribute(ThymeleafConfig.TEMPLATE_ENGINE_ATTR);
  4.     IWebExchange webExchange = JakartaServletWebApplication.buildApplication(getServletContext())
  5.         .buildExchange(request, response);
  6.     WebContext context = new WebContext(webExchange);
  7.        
  8.     context.setVariable("name", "Anderson Almada");
  9.     templateEngine.process("index", context, response.getWriter());
  10. }
Advertisement
RAW Paste Data Copied
Advertisement