Hello. If somebody has a minute, I've been revisiting the use of JSTL after working on some other things for some time. One thing that is kinda occuring to me is the tagclass tag in the tld...is this meant to replace, or it seems to me it could replace, the jsp:useBean... on the jsp? I could declare some sorta collection as an attribute and the tagclass would return it like a javabean method, right? (then use EL syntax to reference the collection on the jsp). Thank you very much for reading this. [ October 27, 2005: Message edited by: Tom Griffith ]
I'm not sure what you mean by this. The <tag-class> element in a tld file is used to identify the class used to implement a custom tag that is being defined within the tld.
It really doesn't have much to do with scoped variables (javabeans stored in the scoped contexts) and not much to do with <jsp:useBean>.
To address the subject of your topic: in a scriptless JSP page using the JSTL, the utility of <jsp:useBean> is greatly diminished. Since no scripting variables are necessary on the page, <jsp:useBean> is no longer necessary to attach such scripting variables to corresponding scoped variables. But recall that <jsp:useBean> can also cause a scoped variable to come into existence (if a scoped variable of the specified scope and id do not already exist), and so I have seen <jsp:useBean> still used in scriptless JSP pages in order to instantiate scoped variables not already made resident by the controller servlet.
I should also add that javabeans themselves are alive and kicking in the JSTL/EL/scriptless JSP world. In fact, scoped variables -- the term for javabeans and other objects stored in the scoped contexts -- have taken center stage in favor of scripting variables.
So there's certainly no vs. between the JSTL/EL and Javabeans. They were made to go hand in hand.
Hi Bear. Thank you for the information. The source of my question was the setAttribute() method within doTag() for a Simple Tag. It seemed to me that this does a lot of work javabeans could/would do. But like you said, javabeans can bring new variables into existence. Is this accurate?