aspose file tools
The moose likes Servlets and the fly likes Data sharing between tags.... Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Data sharing between tags...." Watch "Data sharing between tags...." New topic
Author

Data sharing between tags....

mendy smith
Greenhorn

Joined: Jan 30, 2001
Posts: 19
What are the different ways of sharing data between tags? which is the best and when will each type be appropriate. could anyone please expand on this topic.
Appreciate u'r feedback,
Thanks.
Cynthia Yao
Ranch Hand

Joined: Nov 06, 2000
Posts: 92
I have used two ways.

One is declare pageContext level variables, if the data is shared for several tags, then you have to use it, but the shortcome is that you have to import the necessary library in the jsp. And you also need a extrainfo class to declare it and destroy it in one of tag or declare the variable in the jsp.
the second one is in nested tags, use: findAncestorWithClass
and get the ancestor and get the data out. You will have to declare the tag in the tld file as can contain jsp in it.
here is the official jsp tag tutorial: http://java.sun.com/products/jsp/tutorial/TagLibrariesTOC.html
 
 
subject: Data sharing between tags....
 
Threads others viewed
Sharing data between web app's
Multiple instances of the same portlet behave in a very odd way!!!!
Passing session between two web application
Best Practise and why
2 or more servlet sharing data
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture