JSTL c:import Example

JSTL c:import Example explains about How to use c:import tag inside JSTL
Consider an example, where you need to include a content of a page using JSTL, In that case you can use JSTL c:import Tag
c:import Tag is available as a part of JSTL core tags, c:import Tag provides including of content from other sites to current page
Difference between c:import and jsp:include is that, By using c:import tag we can also provide absolute url such as "http://www.javatips.net". we can also utilize some additional attributes such as url, scope, charEncoding etc
You can see the below example demonstrating the usage JSTL c:import Example inside JSTL
Required Libraries
JSTL c:import Example
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <html> <head> <title>JSTL c:import Example</title> </head> <body> <!--JSTL c:import Example--> <c:import var="content" scope="request" url="http://www.javatips.net" /> <c:out value="${content}" /> </body> </html>