Attribute | Description |
---|---|
import | Import list of packages, classes an interfaces in servlet class definition. Example: <%@ page import = "java.util.Date" %> |
extends | Used to extend the parent class that will be generated by Servlet. Example: <%@ page extends = "mypackage.DemoClass"%> |
language | Defines which scripting language to be used in the page. Example: <%@ page language = "value"%> |
session | Specifies the JSP page participating in an HTTP session. Example: <%@ page session = "true"%> |
buffer | Specifies a buffer model to handle output stream generated by JSP page. Example: <%@ page buffer = "4kb"%> |
autoFlush | Specifies that buffer should be flushed automatically. The default value of autoFlush attribute is ‘true’. Example: <%@ page autoFlush = "false"%> |
info | Sets the information of the JSP page which is retrieved later by using getServletInfo( ) method. Example: <%@ page info = "Given by Surendra Maurya"%> |
contentType | Sets the content of the JSP page. Example: <%@ page contentType="text/html"%> |
isThreadSafe | It is used to define the threading model for the JSP page which is generated by Servlet because JSP and servlet both are thread safe. Example: <%@ page isThreadSafe="false"%> |
errorPage | Define the error page, if any error generates in current page, it will be redirected to the error page. Example: <%@ page errorPage="erroropage.jsp"%> |
isErrorPage | Defines whether the current JSP page is error page or not. Example: <%@ page isErrorPage="true" %> |
isELIgnored | Specifies whether the expression will be evaluated or not in JSP page. Example: <%@ page isELIngored="true" %> |
<html>
<head>
<title>Include Directive</title>
</head>
<body>
<%@ include file = "header.jsp">
</body>
</html>
<html>
<head>
<title>Taglib directive</title>
</head>
<%@ taglib prefix="myTag" uri="http://www.tutorialride.com/java-technologies.htm" %>
<body>
Welcome, <myTag:userName / >
</body>
</html>