I want to pass a variable in tag file. My code here:
layout.tag
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@tag description="My layout" pageEncoding="UTF-8"%>
<%@attribute name="title" type="java.lang.String" required="true" %>
<!DOCTYPE html>
<html>
<head>
<title>My site | <c:out value="${title}" /></title>
</head>
<body>
</body>
</html>
index.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="mySite" tagdir="/WEB-INF/tags" %>
<mySite:layout title="home">
</mySite:layout>`
But <c:out value="${title} />"
always return ${title}
. I tried with ${title}
and got the same result. I dont know why...