JSP Tutorials

JSP include Directive
Previous Home Next
adplus-dvertising

Jsp Include Directive

It is used to include the contents and used a jsp file, html file or text file. which is includes the original content of the included resource at page translation time (the jsp page is translated only once so it will be better to include static resource).

Include directive Advantage

  • Code Reusability

Syntax

<%@ include file="resourceName" %>

Example

It is including the content of the header.html file with run this example you must create an header.html file.

<html>  
    <body>  
    <%@ include file="header.html" %>  
    Today is: <%= java.util.Calendar.getInstance().getTime() %>   
    </body>  
    </html>  
Previous Home Next