Loading
 
What's Next: View All Tutorial →

JSTL Core Tags

Below is the collection of tutorials on JSTL core tags. Each tutorial is explained with the help of screenshots and proper examples. The following line of statement must be present in your JSP in order to use the JSTL core Tags. <%@ taglib pr...

Published Date: 30/08/2014  Last Modified Date: 30/08/2014    New Post



Below is the collection of tutorials on JSTL core tags. Each tutorial is explained with the help of screenshots and proper examples. The following line of statement must be present in your JSP in order to use the JSTL core Tags.

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  1. <c:out> tag: It is used for displaying the content on client after escaping XML and HTML markup tags. Main attributes are default and escapeXML.
  2. <c:set> tag: This tag is useful for setting up a variable value in a specified scope. It basically evaluates an expression and sets the result in given variable.
  3. <c:remove> tag: It is used for removing an attribute from a specified scope or from all scopes (page, request, session and application). By default removes from all.
  4. <c: if> tag: This JSTL core tag is used for testing conditions. There are two other optional attributes for this tag which are var and scope, test is mandatory.
  5. <c:choose> tag: It’s like switch statement in Java.
  6. <c:when> tag: It’s like case statement in Java.
  7. <c:otherwise> tag: It works like default attribute in switch-case statements.
  8. <c:catch>tag: This tag is used in exception handling. In this post we have discussed exception handling using <c:catch> core tag.
  9. <c:import> tag: This JSTL core tag is used for importing the content from another file/page to the current JSP page. Attributes – var, URL and scope.
  10. <c:forEach> tag: This tag in JSTL is used for executing the same set of statements for a finite number of times.
  11. <c:forTokens> tag: It is used for iteration but it only works with delimiter.
  12. <c:param> tag: This JSTL tag is mostly used with <c:url> and <c:redirect> tags. It adds parameter and their values to the output of these tags.
  13. <c:url> tag: It is used for url formatting or url encoding. It converts a relative url into a application context’s url. Optional attributes var, context and scope.
  14. <c:redirect> tag: It is used for redirecting the current page to another URL, provide the relative address in the URL attribute of this tag and the page will be redirected to the url.
Awaiting for Administrator approval




← Back to list


Related Post




×