In case of parsing a large thymeleaf template which exceeds the catalina output buffer size(8kb), the response writer would flush when the buffer is full, which then set the response committed field to true even if the whole parsing template process is not finished yet. If a csrf token is needed after that (for example a "th:action" attribute), and no session is created before, then a "Cannot create a session after the response has been committed" exception will be thrown.
any way to workaround this if i cannot reduce the size of the template?