Programming Blog

This blog is about technical and programming questions and there solutions. I also cover programs that were asked in various interviews, it will help you to crack the coding round of various interviews

Friday 2 March 2018

JSP include directive

JSP Include Directive

The include directive is used to include the contents of any resource it may be jsp file, HTML file or text file. The include directive 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).

Syntax of include directive

<%@ include file="resourceName" %>  

Example of include directive

In this example, we are including the content of the header.html file. To 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>  

No comments:

Post a Comment