Skip to content

Commit 7325cb7

Browse files
Fixed parsing error when hitting F5 on a login error page with expired session
1 parent 1f5a98f commit 7325cb7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

booking-mvc/src/main/webapp/WEB-INF/login.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@
6565

6666
<div class="error" th:if="${param.login_error}">
6767
Your login attempt was not successful, try again.<br /><br />
68-
Reason: <span th:text="${session[__${lastExceptionKey}__].message}">Invalid password</span>
68+
<span th:if="${session} and ${session[__${lastExceptionKey}__]}">
69+
Reason: <span th:text="${session[__${lastExceptionKey}__].message}">Invalid password</span>
70+
</span>
6971
</div>
7072

7173
<form name="f" action="#" th:action="@{/loginProcess}" method="post">
@@ -78,7 +80,7 @@
7880
<label for="j_username">User:</label>
7981
<br />
8082
<input type="text" name="j_username" id="j_username"
81-
th:value="${param.login_error} ? ${session[__${lastUsernameKey}__]} : ''" />
83+
th:value="(${param.login_error} and ${session}) ? ${session[__${lastUsernameKey}__]} : ''" />
8284
</p>
8385

8486
<script type="text/javascript">

0 commit comments

Comments
 (0)