-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
With Tomcat, I can't make Bastillion work.
I found that in TemplateServlet::doGet, variable uri just equals '/'. Thus Thymeleaf fails to find the template.
This makes the trick :
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
TemplateEngine engine = TemplateConfig.getTemplateEngine(request.getServletContext());
WebContext context = new WebContext(request, response, request.getServletContext());
context.getResponse().setContentType("text/html; charset=UTF-8");
String uri = request.getRequestURI()
.replaceAll("\\" + TemplateServlet.VIEW_EXT + ".*", TemplateServlet.VIEW_EXT)
.replaceAll("^" + request.getContextPath(), "");
if (StringUtils.equals("/", uri)) {
uri = "/index.html";
}
engine.process(uri, context, response.getWriter());
}
Any objection to a pull-request?
Metadata
Metadata
Assignees
Labels
No labels