JSP: If else in JSTL

And if statement in JSTL is:

<c:if test="${true}">
	Hiya
</c>

And if-else is actually choose-when-otherwise:

<c:choose>
	<c:when test="${true}">
		Hiya
	</c:when>
	<c:otherwise>
		Bye
	</c:otherwise>
</c:choose>

Don't forget to include the jstl taglib.

java-jsp java-jstl java

Edit on github
comments powered by Disqus
Click me