两个判断条件相反即可:<span th:if="${session.loginError == null}" class="passwordnone error name" th:text="#{login.passwordNull}"></span>
<p th:if="${session.loginError != null}"><span class="passworderror name error" style="visibility:visible" th:text="#{login.passwordError}"></span></p>
<p th:if="${session.loginError != null}"><span class="passworderror name error" style="visibility:visible" th:text="#{login.passwordError}"></span></p>