Custom tag runtime expression problem

2005-08-18 Thread Frank W. Zammetti
Hi all,

I'm using Tomcat 5.0.29.  I've created a custom tag and I need to be able
to use runtime expressions for certain attributes.  But it isn't working
and I'm beating my head on the desk trying to figure out why.

Here's my TLD:

?xml version=1.0 encoding=UTF-8?
!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
tlibversion1.2/tlibversion
jspversion1.1/jspversion
shortnamemytags/shortname
uricom/company/taglib/uri
tag
namebutton/name
tagclasscom.company.app.taglib.ButtonTag/tagclass
bodycontentempty/bodycontent
attribute
nameid/name
requiredtrue/required
rtexprvaluetrue/rtexprvalue
/attribute
attribute
nameonClick/name
requiredtrue/required
rtexprvaluetrue/rtexprvalue
/attribute
attribute
/tag
/tag
/taglib

Specifically, I'm trying to do this on the page:

%@ taglib uri=/WEB-INF/apptags.tld prefix=app %
...
% String fName = (String)hm.get(name); %
app:button id=btnSelect onClick=selectAll(%=fName%); /

Now, the button renders its code just fine, the *ONLY* thing that isn't
working is that the emitted HTML includes the string %=fName% instead of
it being evaluated.  I've verified that the fName string *DOES* get the
appropriate value in it.  So, as near as I can tell, the taglib code
itself, all the setup, etc., is fine, *EXCEPT* for the ability to do
runtime expressions like this.

What am I missing?  Does this need to be turned on in Tomcat or something?
 I wouldn't think so, but I'm at a loss.

Thanks!

Frank

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Custom tag runtime expression problem

2005-08-18 Thread Rahul Akolkar
On 8/18/05, Frank W. Zammetti [EMAIL PROTECTED] wrote:
 Hi all,
 
 I'm using Tomcat 5.0.29.  I've created a custom tag and I need to be able
 to use runtime expressions for certain attributes.  But it isn't working
 and I'm beating my head on the desk trying to figure out why.
 
 Here's my TLD:
 
 ?xml version=1.0 encoding=UTF-8?
 !DOCTYPE taglib PUBLIC -//Sun Microsystems, Inc.//DTD JSP Tag Library
 1.1//EN http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd;
snip/

I'd go with a 2.0 TLD since you're on TC 5.x. Is that possible? Plus
you will get to use EL instead of JSP expressions in tag attribute
values.

-Rahul

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Custom tag runtime expression problem

2005-08-18 Thread Wade Chandler
Don't know exactly, but a good place to look is the
source code for the JSTL from commons.  They are
making some calls in there to transform the values of
EL and expressions.

Wade

--- Frank W. Zammetti [EMAIL PROTECTED] wrote:

 Hi all,
 
 I'm using Tomcat 5.0.29.  I've created a custom tag
 and I need to be able
 to use runtime expressions for certain attributes. 
 But it isn't working
 and I'm beating my head on the desk trying to figure
 out why.
 
 Here's my TLD:
 
 ?xml version=1.0 encoding=UTF-8?
 !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
 tlibversion1.2/tlibversion
 jspversion1.1/jspversion
 shortnamemytags/shortname
 uricom/company/taglib/uri
 tag
 namebutton/name

tagclasscom.company.app.taglib.ButtonTag/tagclass
 bodycontentempty/bodycontent
 attribute
 nameid/name
 requiredtrue/required
 rtexprvaluetrue/rtexprvalue
 /attribute
 attribute
 nameonClick/name
 requiredtrue/required
 rtexprvaluetrue/rtexprvalue
 /attribute
 attribute
 /tag
 /tag
 /taglib
 
 Specifically, I'm trying to do this on the page:
 
 %@ taglib uri=/WEB-INF/apptags.tld prefix=app
 %
 ...
 % String fName = (String)hm.get(name); %
 app:button id=btnSelect
 onClick=selectAll(%=fName%); /
 
 Now, the button renders its code just fine, the
 *ONLY* thing that isn't
 working is that the emitted HTML includes the string
 %=fName% instead of
 it being evaluated.  I've verified that the fName
 string *DOES* get the
 appropriate value in it.  So, as near as I can tell,
 the taglib code
 itself, all the setup, etc., is fine, *EXCEPT* for
 the ability to do
 runtime expressions like this.
 
 What am I missing?  Does this need to be turned on
 in Tomcat or something?
  I wouldn't think so, but I'm at a loss.
 
 Thanks!
 
 Frank
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]