After switching to thymeleaf, you should not do this in the backend but use thymeleaf @{"/#/activate(key=${user.activationKey})"}