What are the different types of directive tags in JSP?

JSP has following directive tags:

  • Page: This directive is used for page related attributes. It can be put anywhere in the JSP page. But by convention we put it on the top of the page.
    E.g.
    <%@ page attribute=”value”%>
  • Taglib: We can create custom tags in JSP and use these by taglib directive in a JSP page.

    E.g.

    <%@ taglib uri=“abc.html” prefix=“tag_prefix”% >
  • Include: We use include directive to read a file and merge its content with the JSP page. This is done during compilation stage.
    <%@ include file=”relative url”% >
Read the full book at www.amazon.com
Posted in JSP, JSP Interview Questions

Leave a Reply

Your email address will not be published. Required fields are marked *

*