You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by am...@ca.ibm.com on 2002/04/18 16:20:07 UTC

Extending tag

I am interested in extending <jsp:useBean> tag. I want to add product
specific calls to code within this tag, which are always performed.

What is the best way to accomplish this. Should I implement all function
done by <jsp:useBean> in the new tag or is there a way to extend the
existing TagHandler class for this tag. How do I find that tag handler
class?


Asha Mishra,
Project Lead, Commerce Models
WebSphere Commerce Suite
IBM Canada Ltd., A2-710
8200 Warden Avenue
Markham, ON  L6G 1C7
Phone:  (905)413-4223 (T/L 969) Fax  (905) 413-4751
 e-mail: amishra@ca.ibm.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Extending tag

Posted by Shawn Bayern <ba...@essentially.net>.
On Thu, 18 Apr 2002 amishra@ca.ibm.com wrote:

> I am interested in extending <jsp:useBean> tag. I want to add product
> specific calls to code within this tag, which are always performed.
> 
> What is the best way to accomplish this. Should I implement all
> function done by <jsp:useBean> in the new tag or is there a way to
> extend the existing TagHandler class for this tag. How do I find that
> tag handler class?

Since <jsp:useBean> is a JSP standard action, it's generally implemented
within a container, not using the "tag extension protocol" (e.g., the Tag
interface, which I think is what you mean by TagHandler).

Thus, to implement its function portably, you'd need to write it from
scratch.

If you're interested only in the part of its functionality that affects
scoped variables, you can look at the handler for <c:set> in the JSTL
reference implementation.  I've written code like that handler to be as
general and instructive as possible, so it might help.

-- 
Shawn Bayern
Author, "JSP Standard Tag Library"  http://www.jstlbook.com
(coming this summer from Manning Publications)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>