Gunakan variabel thymeleaf dalam javascript
<script th:inline="javascript"> // Enable Thymeleaf inlining
var email = [[${user.email}]]; // Behaves just like in HTML
</script>
Odd Oyster