lundi 20 juillet 2015

Thymeleaf: th:text only if not null?

I have something like below, which of course works if user had previously input his wrong credentials.

However if I directly go to my login fail url /login?error for example without any previous incorrect logins, session[SPRING_SECURITY_LAST_EXCEPTION] is of course null and I get a nasty 404.

<span th:text="${session[SPRING_SECURITY_LAST_EXCEPTION].message}">Invalid credentials</span>

Question:

Is there a processor for something like below (which is too long to write and read most of the time), or should I just roll my own?

Aucun commentaire:

Enregistrer un commentaire