jsp Directives Simple example

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!


Directives, as the name suggests, are direction or instructions for the container to follow when translating a JSP to a servlet. There are 3 directives namely page, include and taglib which you can use in your JSP.

Below is a simple example of using page directive:

<%@ page isErrorPage="true" %>

This would instruct the container that the JSP file containing this line is an error page.

Directives can be used be put anywhere in your JSP file, but the convention is to put at the top/beginning of the JSP file

Got any jsp Question?