Reputation: 12720
I am using JSP 2.1 in a Java EE web application.
My JSP page is something like this:
<html><body>
<% String myText = (String) request.getAttribute("myText"); %>
<h1><c:out value="${myText}"/></h1>
</body></html>
if myText="h & b", then the generated html page is:
<html><body>
<h1><c:out value="h & b"/></h1>
</body></html>
so, the c:out instructions has not been processed.
Replacing the first line by:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core">
does not help; still the same problem.
If I add the following line at the top of the jsp page:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
or this one:
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
I get the following error: No tag library could be found with this URI. Possible causes could be that the URI is incorrect, or that there were errors during parsing of the .tld file.
What is the problem?
ps: and what documentation should I read about this? I am reading the JSP 2.1 spec, but I don't find the answer. http://download.oracle.com/otn-pub/jcp/jsp-2.1-fr-eval-spec-oth-JSpec/jsp-2_1-fr-spec.pdf
Upvotes: 1
Views: 846
Reputation: 7197
You need to have a JSTL implementtion in your class path. You can for example download an implementation from Apache.
Upvotes: 1