Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

TagExtraInfo issue/question  RSS feed

 
Greg T Robertson
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's say I have a taglib called exposeInformation. exposeInformation has a TLD that says it takes one required parameter named bar that is allowed to be a rtexprvalue (run time expression value). It has a teiclass foo. Foo has extedned TagExtraInfo to override the getVariableInfo(TagData). getVariableInfo calls data.getAttributeString("bar") to see if the value is there (and hey it always should be). This works if and only if bar is not a runtimexprvalue. Even if bar is bar="<%= new String("Some text") %>", I get a ClassCastException. I thought the purpose of getVariableInfo was to let the compiler know that I was going to be putting into the page a variable named whatever bar's value is. Why doesn't this work? And is there a way to do it?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post:

1) The tld entry for the tag
2) The code for the tag class
3) The code for the tei class
4) The stack trace for the error (trimmed to the interesting parts)

(Please be sure to use the UBB code tag to preserve code formatting)
 
Greg T Robertson
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The tld


Tag class (other than getters & setters)


The tei only overrides getVariableInfo


The stack trace looks like this:
(sometwhat trimmed)

This is only when id has a runtime expression value if it's this it works. I know why it's failing it's because the data.getAttributeString believes that it's an Object not a String. Am what I am trying to do legitimate?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm, I don't see it on inspection.

I am assuming that IfsApplicationKeys.HEADER_CONTENT_SESSION is a String?
 
Greg T Robertson
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it is. Declared as public static final String in the class IfsApplicationKeys. In fact you can go so far as to do and it will fail as well. I am stumped by it. Even better it's not just on the id variables - it's literally on any var that a rtexprvalue is true for and has a getVariableInfo method like what I posted.
[ June 03, 2004: Message edited by: Greg T Robertson ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm. This isn't something (tei's generating scripting variables) I've dealt with in quite a while (since the advent of JSP 2.0 and the JSTL, I no longer use scripting variables on my pages), so it's not jumping out at me.

I can't make any promises but if I can free up some time I'll set up a mini-app using your code and see what I can deduce.

I don't know if it would be helpful in this case but something you might want to try is to track down the Java file that the container is creating from your JSP, look at the code it is generating for your tags, and see if you can spot anything illuminating.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!