I get information about user and send it with AJAX to server.
this work fine:
<script>
/*<![CDATA[*/
data.orderId = [[${theOrder.id}]];
data.UserId = [[${#authentication.getPrincipal().getId()}]]; /*]]>*/
</script>
When I add One more:
/*<![CDATA[*/ data.fromUserName = [[${#authentication.getPrincipal().getName()}]]; /*]]>*/
it broke the code and throw error in browser console: Uncaught SyntaxError: Unexpected identifier. I check .getName() on thymeleaf and it work.