List the JSTL core tags and explain any two with example.
JSTL Core Tags
-
c:out
- c:import
- c:set
- c:remove
- c:catch
- c:if
- c:choose
- c:when
- c:otherwise
- c:forEach
- c:forTokens
- c:param
- c:redirect
- c:url
c:out
-
It display the result of an expression, similar to the way <%=...%> tag work.
- <%@ taglib uri= "http://java.sun.com/jsp/jstl/core" prefix="c" %>
- <html>
- <body>
- <c:out value="${'Welcome to JSTL'}" />
- </body>
- </html>
c:import
-
It is similar to jsp 'include', with an additional feature of including the content of any resource either within server or outside the server.
- <%@ taglib uri= "http://java.sun.com/jsp/jstl/core" prefix="c" %>
- <html>
- <body>
- <c:import var="data" url="http://www.darshan.ac.in" />
- <c:out value="${data}" />
- </body>
- </html>