JSTL Core import Tag


JSTL Core import Tag

JSTL Core import Tag is use to get the content of JSP or html page into current context. It is similar JSP include tag.

JSTL Core import Tag will read data from either within server or outside the server.

Syntax

<c:import var="var_name" url="page_name"/> 
<c:out value="${data}"/>  

Example

  1. header.jsp
  2. jstl.jsp

header.jsp

WWW.JAVAENOTES.COM

jstl.jsp

<%@ 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>JSTL Examples</title>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
</head>
<body>
 <c:import var="myData" url="/header.jsp" />
 <c:out value="${myData}" />
</body>
</html>

Output

WWW.JAVAENOTES.COM






Full-stack web and mobile app development company Contact Us : Skype: indore.webcoder Email: info@w3sparks.com Sales: +91 8085506229