Portal component:Localized texts in ThymeLeaf

Hi, forum followers.

I’m newbie in Portal component and I try to implement externelised text in the web site with ThymeLeaf, using th:text with location of externalized text based on .properties files.

In PortalController class there is the creation of a Thymeleaf context, as you can see on next code fragment:

 @RequestMapping(value = "/", method = RequestMethod.GET)
    public String index(Model model, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext, TemplateEngine templateEngine){
                WebContext ctx = new WebContext(request, response, servletContext, request.getLocale());
        try {
            templateEngine.process("index", ctx, response.getWriter());
        } catch(IOException e){
            log.error("Error ",e);
        }
        return "index";
    }

In execution next error appears: HTTP-500 No primary or default constructor found for interface javax.servlet.ServletContext

What context should I use to achieve for using th:text in the template for externalized text based on properties files?.

Thanks in advance.

Hi,
Finally, I’ve just discovered that, from Cuba-Platform v. 6.9, Localized messages for the https://www.thymeleaf.org/[Thymeleaf] templates in the portal module can also be obtained by the message key from the main message pack of the portal module.

Regards,