JSP Directives

JSP Directives: JSP directives provides the instructions and directions to the web container about how to control the processing JSP page.


<%@ directiveName attributeName=”attributValue” %>

Types of JSP directives:

  • page directive.
  • include directive.
  • taglib directive.

Import Attribute Of JSP Page Directive

This attribute is used to import interface, classes or whole package. You can import more than one package separated by commas.


<%@page import=”value1,value2…”%>


<%@ page import=”java.util.Date” %> 
                        <title>import page directive example</title>
                        Current date: <%= new Date() %>
Scroll to Top