In this JSP Tutorial, we will see how to include html file inside a JSP page using include page directive.
1 2 3 4 5 6 7 8 |
<!-- Sample 01: Define the include content --> <!DOCTYPE html> <p style="font-size: 16px; color: teal; font-family: 'Arial Black'; text-decoration: underline overline"> ABC Stores Welcomes You!!! </p> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> <!-- Sample 02a: Include the File Content --> <%@include file="WelcomeTitle.html" %> <p> This is the sites content. It can have both static and dynamic texts. </p> <!-- Sample 02b: Include the File Content --> <%@include file="WelcomeTitle.html" %> </body> </html> |
Categories: JSP