Checking Request Attribute in JSP

I am trying to check the request attribute in jsp to show / hide specific html.

request.setAttribute("submitted", "true"); 

JSP:

 <c:if test="${submitted == 'false'}"> // some html </c:if> 

But no matter what value I set in the attribute, the condition is always evaluated as false. Is the attribute invisible inside the condition?

Sahil

+4
source share
1 answer

Try this instead:

 request.setAttribute("submitted", true); 

and in your JSP:

 <c:if test="${submitted}"> // some html </c:if> 
+6
source

All Articles