This tag <c: import> is used to import the absolute URL and show the content to another page. Some mandatory attributes are used to implement on this tag like “URL” this attribute use to retrieve and import the content from one page to another page. Other attributes like “scope” and “var” these are also used as required but this are not compulsory for using in this tag.
<%@ taglib uri=”http://java.sun.com/jsp/jstl/core” prefix=”c” %>
<html>
<head>
<title>Thats The<c:import>Tag Example In J.S.P</title>
</head>
<body>
<c:import var=”desc” url=”/definition.jsp”/>
<c:out value=”${desc}”/>
</body>
</html>
That’s the page where we gave the reference of another URL which will use to show the result on web browser.
<%@ taglib uri=”http://java.sun.com/jsp/jstl/core” prefix=”c” %>
<html>
<head>
<title><c:out>Example In J.S.P</title>
</head>
<body>
<p><center><br><b><c:out value=”This is The Example Of C:IMPORT Tag… “/></b></br></center></p>
</body>
</html>
That’s the page where the URL will be imported and shows the output on web browser.