Directive Tag

The directive tag provides the information that affects the overall translation of the JSP page. They are used to set global values such as class declaration, method implementation so on. This tad does not produce any output to the client. This tag begins with <%@ and end with %>
Syntax of Directive tag
<%@ directiveName attribute="value " % >
There are three main Directives
  1. The page directive
  2. The include directive
  3. The taglib directive
Example of directive tag
<html> <head> <title>Welcome to directive tag </title> </head> <body> <%@ include file="index.jsp" %> </body> </html>
<html> <head> <title>Welcome to expression tag example </title> </head> <body> <%! int couter= 10; public String login(String name) { return "Welcome " + name ; } %> <p> The Value of Counter <%= couter %> </p> <p> Hello you are most <%= login("Sunil") %> </p> </body> </html>
Download this example


Latest Tutorial

Most Visited Tutorial