The tag lib directive is used in JSPs to include tag libraries.
< % @ taglib uri=http://www.myCompany.com/myTagLibrary prefix="myLibrary" % >
This is how you include a tag library into a JSP
There is no limit as such. You can use one or more Page Directives in a JSP but you cannot have duplicates
The Page Directive is one of the important components of any JSP Page. It can help us define page specific properties like Buffer size or location of an error page etc A JSP page, and any files included via the include directive, can contain one or more page directives but no duplicates. The JSP container will apply all the attributes to the page. The position of these page directives is irrelevant, but it is good practice to keep them together at the top of the page. (So that we can identify them easily)
JavaServer Pages (JSP) uses several types of tags for various functionalities. The main categories include directive tags (like <%@ page %>, <%@ include %>), which provide information about an entire JSP page, declaration tags (using <%! %>), which allow the definition of methods and variables, and scriptlet tags (enclosed in <% %>), which contain Java code. Additionally, there are expression tags (<%= %>) for outputting data, and custom tags that can be defined by developers for reusable components. JSP also supports standard tag libraries such as JSTL (JavaServer Pages Standard Tag Library) for common tasks like iteration and conditionals.
Containers or special directives, which group other directives... (open and close tag reffers to <>) directive example: Directory Container or especial directive example: <Directory> ......... </Directory>
You can display data in Tabular format in a JSP page using the HTML <Table> Tag. You can even assign dynamic values to the table using JSP Scriptlets. <% %>
An open and closed tag directive is commonly referred to as an "element" in HTML and XML contexts. An element consists of a start tag (open tag) and an end tag (closed tag) along with any nested content. For example, in the tag <p>Content</p>, the entire structure represents a paragraph element.
You can use the errorPage attribute of the page directive. If this attribute is defined in a JSP page, when a run time exception is encountered, the control will be transferred to this JSP page. This error page can access details of the Exception from the request and use it to display a logical message to the user.
JSP SkeletonBelow is how a Skeleton JSP File would look like. (The file has to be saved as .jsp)// Page Imports// Tag Library References// here xx refers to the prefix with which the tag library will be referred to// HTML Head & Title Content// Java Script Content// HTML Body & Form ContentsNote: Java code can be placed within the tags in the body part of the JSP page within the Body tags
The Difference between JSTL and JSP is that, JSP lets the person add embedded Java code into HTML pages. Also JSP allows the person to define their own tags. JSTL is just a standard tag library provided by Sun to carry out common tasks.
In JSP, the extends attribute is used in the <jsp:directive.page> tag to specify a superclass for the JSP page. This allows the JSP to inherit methods and properties from the specified Java class, enabling code reuse and organization. By extending a class, you can implement custom functionality or override methods, enhancing the capabilities of your JSP. For example, you might use extends to create a base page class that handles common logic for multiple JSP files.
by using the meta tag <meta HTTP-EQUIV="Refresh" CONTENT="5(duration in sec)">
by using the meta tag <meta HTTP-EQUIV="Refresh" CONTENT="5(duration in sec)">