File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes how to communicate between tag & tagExtraInfo Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "how to communicate between tag & tagExtraInfo" Watch "how to communicate between tag & tagExtraInfo" New topic

how to communicate between tag & tagExtraInfo

Vikram Kamate

Joined: Sep 28, 2002
Posts: 16
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
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

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!
[ November 10, 2002: Message edited by: Bear Bibeault ]

[Asking smart questions] [About Bear] [Books by Bear]
Vikram Kamate

Joined: Sep 28, 2002
Posts: 16
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

Joined: May 10, 2000
Posts: 1913
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...
I agree. Here's the link:
subject: how to communicate between tag & tagExtraInfo
It's not a secret anymore!