Sto provando a verificare in JSTL se un attributo di sessione è vuoto. Tuttavia, l'attributo è vuoto. JSTL lo vede come un attributo non vuoto.JSTL: controlla se una stringa è vuota
Questo è l'hardcode che sto cercando di sostituire con JSTL. Questo codice funziona correttamente:
<% if (request.getAttribute("error") != null) { %>
<div class="alert alert-danger">
<strong>Oh snap, something's wrong, maybe the following error could help you out?<br /></strong>
<%= request.getAttribute("error")%>
</div>
<% } %>
Ecco come ho sostituito con JSTL. Se selezionato, l'attributo-errore non è vuoto, tuttavia è vuoto.
<c:if test="${not empty sessionScope.error}">
<div class="alert alert-danger">
<strong>Oh snap, something's wrong, maybe the following error could help you out?<br /></strong>
<c:out value="${sessionScope.error}" />
</div>
</c:if>
hai aggiunto libreria JSTL – gyanu
hai importato tag JSTL nella pagina ** <% @ taglib uri = "http://java.sun.com/jsp/jstl/core" prefisso = "c"%> ** – gyanu
Questo era davvero il problema. Stavo risolvendo il problema per più di un'ora. Grazie :) – DaanCelie