I am a bit new to Thymeleaf, so apologies if this is a newb syntax mistake.
I am trying to have Thymeleaf execute multiple statements in the same th:with attribute.
<div th:with="url = ${#httpServletRequest.getRequestURL()}, url = ${url.substring(0, url.indexOf('error'))}"></div>
But this is not the correct syntax.
org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as assignation sequence: "url = ${#httpServletRequest.getRequestURL()}, url = url.substring(0, url.indexOf('error'))" (error/404:11)
Is this possible, and if so what is the correct syntax for what I'm trying to accomplish?
EDIT: There was a syntax error in the part below that I have fixed, and now I'm getting a different error.
Tried breaking it into two, but then it appears that the url variable is not populated correctly in the SpringEL expression.
<div th:with="url = ${#httpServletRequest.getRequestURL()}">
<div th:with="url = ${url.substring(0, url.indexOf('error'))}"></div>
</div>
org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as assignation sequence: "url = ${url.substring(0, url.indexOf('error')})" (error/404:12)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1