Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to communicate between tag & tagExtraInfo

 
Vikram Kamate
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am writting generic Tag for executing database query, in this I am executing query in Tag class in doInit method and setting attribute in doAfterBody.
and in TagExtraInfo I want generate jsp scripting varibables for each column with same name of column.
now my problem is I am not able to pass names of columns from tag class to TagExtraInfo class.
Thankx & regards
Vikram.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless I miss by guess, that can't really happen. The TagExtraInfo class is used at translation time, but the Tag classes aren't created until request time.
You can probably get whatever info you need from the TagInfo instance that you can obtain from the getTagInfo() method of TagExtraInfo.
Remember the javadocs are your friends!
hth,
bear
[ November 10, 2002: Message edited by: Bear Bibeault ]
 
Vikram Kamate
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thankx a lot bear,

you are right, TagExtraInfo is executed at translation time.
But I have basic dought, what is use of TagExtraInfo if we can define scripting varibles only once per tag that too translation time. It could be accomplied by tld file, but I know why sun has choosen this way.

anyway is it possible to define different varibles at runtime?
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the example on page 158 of Chapter 6 from Professional JSP Tag Libraries. The tag API allows you get access to some of the request-time information such as the values of attributes.
Hope this helps...
Simon
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic