this question has answer here:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> //line-1 <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c1" %> //line-2 is there difference between line-1 , line-2. line-2 in jsp file not giving error line-1 in jsp giving error
can not find tag library descriptor "http://java.sun.com/jsp/jstl/core"
i've seen solution of problem here not understand "facelets"
it true facelets 1.x , 2.x uses different namespaces jstl tag library. less or more namespace bug in facelets 1.x , has been fixed facelets 2.x.
- the real jstl 1.0 taglib uses uri http://java.sun.com/jstl/core.
- the real jstl 1.1/1.2 taglib uses uri http://java.sun.com/jsp/jstl/core.
- facelets 1.x uses uri http://java.sun.com/jstl/core.
- facelets 2.x uses uri http://java.sun.com/jsp/jstl/core.
- facelets 2.2+ uses uri http://xmlns.jcp.org/jsp/jstl/core.
you can find facelets 2.x tags in facelets tag library documentation. facelets don't ship full tag set real jstl taglib. few of
<c:xxx>, full set of<fn:xxx>copied facelets.<fmt:xxx>,<sql:xxx>,<xml:xxx>tags not taken on in facelets.
if using (uses jstl 1.2)
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
means use el expressions not need <c:out>. can directly insert el expressions onto jsp page ${propertyname}
while using (uses jstl 1.0 deprecated)
<%@taglib prefix="c" uri="http://java.sun.com/jsp/core" %>
you can not use el expressions directly on jsp page need <c:out>. el expressions on page not work. e.g. <c:out value=”${propertyname}”>.
also web-app version (found in web.xml) should down 2.3 use http://java.sun.com/jsp/core again old.
conclusion:
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> - can use el directly
<%@taglib prefix="c" uri="http://java.sun.com/jsp/core" %> - can not use el directly
Comments
Post a Comment