tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Raible <MRai...@RESORTQUEST.com>
Subject RE: Tag Attribute Doesn't Have Expression Interpreted
Date Thu, 23 Oct 2003 21:47:31 GMT
Add this after <name> in your .tld
 
<rtexprvalue>true</rtexprvalue> 

-----Original Message----- 
From: Paul D. Gillen [mailto:Paul_Gillen@RiverAlph.com]
Sent: Thursday, October 23, 2003 3:33 PM
To: TomcatDiscussion
Subject: Tag Attribute Doesn't Have Expression Interpreted


Having not gotten a reply to an earlier post, and being of the impatient
sort, I cobbled together a pared down demo of a problem I'm having where a
tag's attribute is given a value from an expression but the expression is
never interpreted.
 
HTML:
<%@ page 
language="java" 
contentType="text/html"
%>
<%@ taglib uri="/WEB-INF/tlds/default.tld" prefix="tt" %>
<html>
<head>
 <%
 String foo = "expression";
 %>
</head>
<body>
 <tt:tTag var="<%=foo%>" />
</body>
</html>
 
TAG SOURCE:
package org.tagTest;
 
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
 
public class ttag extends TagSupport
{
 private String var;
 
 public void setVar(String v) { var = v; }
 
 public int doEndTag ()
 {
  try { pageContext.getOut().println(var); }
  catch(Exception e) { }
  return EVAL_PAGE;
 }
}
 
TAGLIB DEFS:
<?xml version="1.0" encoding="ISO-8859-1" ?>
 
<!DOCTYPE taglib
 PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
 "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
 
<taglib>
 <tlibversion>1.0</tlibversion>
 
 <jspversion>1.1</jspversion>
 <shortname>tagTest</shortname>
 
 <tag>
  <name>tTag</name>
  <tagclass>org.tagTest.ttag</tagclass>
  <attribute>
   <name>var</name>
  </attribute>
 </tag>
</taglib>
 
RESULTANT PAGE SOURCE:
<html>
<head>
 
</head>
<body>
 <%=foo%>
 
</body>
</html>



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message