Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL 1.1 tag c:out

 
Mohammad Miazi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting some problems with c ut tag; I am not sure whether this is the expected behavior.

myjstl.jsp
============
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<c ut value="${param.name}" />
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /customtag.jsp(12,1) According to TLD or attribute directive in tag file, attribute value does not accept any expressions
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)

However if I specify <c ut value="hello world" />, it can display hello world.

Can't value attribute of <c ut> evalute runtime expression?
I am using tomcat 5.0.28, I think it supports JSP 2.0 (so definitely jstl 1.1)
 
Mohammad Miazi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the problem, it was the taglib directive decleration:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
The correct one should be:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

After adding this it works accordingly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic