• jQuery
  • RubyonRails
  • Servlet
  • Struts
  • JSP
  • Core Java
  • Spring
  • SQL Tutorial
  • JavaScript

  • <

    JSP Taglib Directive

    It is used to define the tag library prefix "taglib" .It can be used by using JSP standard tag libraries.


    Taglib Directive Syntax

    <%@ taglib prefix="prefixOfTag" uri="uriOfTagLibrary" %>
    


    Use of Taglib Directive

    To use the JSTL in your application you must have the jstl.jar in your webapps /WEB-INF/lib directory.



    different groups of JST libraries :


  • Core Tags - http://java.sun.com/jsp/jstl/core

  • Formatting Tags - http://java.sun.com/jsp/jstl/fmt

  • SQL Tags - http://java.sun.com/jsp/jstl/sql

  • XML Tags -http://java.sun.com/jsp/jstl/xml

  • JSTL Functions - http://java.sun.com/jsp/jstl/functions


  • Taglib Directive Example


    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
        <%@ taglib prefix="protutorialplus" uri="http://java.sun.com/jsp/jstl/core" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Taglib Directive JSP</title>
    <protutorialplus:hello/>
    </head>
    <body>
    </body>
    </html>
    
    
















    © copyright 2017-2021 Completedone pvt ltd.