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.
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 ]
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?
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