Page Directive
The page directive is used to provide
instructions to the container about how to translate and execute the JSP page.
It is typically placed at the top of the JSP page and enclosed within <%@
and %> tags.
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page import="java.util.*" %>
Here are some commonly used attributes of the page
directive:
language - Specifies the programming language used in the
JSP page (default is Java).
contentType - Specifies the MIMEMultipurpose Internet Mail Extension) type and character encoding of the response.
import - Specifies a list of Java classes or packages to
be imported.
session - Specifies whether to enable or disable session
tracking for the JSP page.
errorPage - Specifies the URL of the error page to be
displayed if an exception occurs.
The included file must be a valid JSP page or HTML file.
The path to the included file can be absolute or relative
to the current JSP page.
The included file can also contain other include
directives, allowing you to chain multiple files together.
No comments:
Post a Comment