RE: Taglib on tomcat 4.1.24
Hi Dick. I'm agree with you and I will follow your advices. If I find some problems I'll post a Bug on Bugzilla. Thx for your explanations. Cheer Arnaud > -Message d'origine- > De : Dick Zetterberg [mailto:[EMAIL PROTECTED] > Envoyé : mardi 1 avril 2003 17:42 > À : [EMAIL PROTECTED] > Objet : Re: Taglib on tomcat 4.1.24 > > > > > > I'm agree with you but what about properties used by the tag ?? > > For instances variables I can reset them in the begin of doStartTag. > > But for an optional attribute of a tag I can't. > > If for example I have a property foo : > > > > String foo = ""; > > > > If I use a first time the tag with this property : > > > > > > and a second time without this property > > > > > > In the second time my property is always setted to "bar" > and not to "". > > I can't reset it manually in the doStartTag because I will > delete the value > > is the property is setted. > > > Hi, > > I do not think you should do anything in your tag to manage > or reset that. Since the sets of attributes are different for > the two invocations they same tag instance should not be used > for them. > So you should never try to modify the attributes of your tag > (with attributes I mean the attributes you have specified in > your tag library descriptor), from within your tag. The > container should handle them. > For example, in Resin, if the same tag is called with the > same attribute several times Resin does not even call the > setXXX method for that attribute the second time, since it > knows that the attribute has not changed. > Now if your example with mylib:mytag above does not work, and > you are not messing with the attributes then of course it is > possible that it is a Tomcat bug. I use Tomcat4.1.12 and have > similar tags and they work ok though. > Hope this was of any help. > > Best regards, > > Dick Zetterberg > [EMAIL PROTECTED] > > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Taglib on tomcat 4.1.24
> -Message d'origine- > De : Simon MacMullen [mailto:[EMAIL PROTECTED] > Envoyé : mardi 1 avril 2003 15:05 > À : Tomcat Users List > Objet : RE: Taglib on tomcat 4.1.24 > > > > > > perhaps the new tomcat manager keep to much things in cache... > > > > Absolutely. Tag instances may be re-used. This means you can > > > only do setup for your tag at the last minute in doStartTag(). > > > doStartTag ??? > > isn't it doEndTag ?? > > Well, I meant "get things ready for your tag", not "clean up > after" (as you seem to be implying) and I specifically meant > "as opposed to in constructors, instance initialisers, > property writers, etc". I'm agree with you but what about properties used by the tag ?? For instances variables I can reset them in the begin of doStartTag. But for an optional attribute of a tag I can't. If for example I have a property foo : String foo = ""; If I use a first time the tag with this property : and a second time without this property In the second time my property is always setted to "bar" and not to "". I can't reset it manually in the doStartTag because I will delete the value is the property is setted. How can I manage this ??? Have you an idea ?? Cheers Arnaud . > > > But if I use the doEndTag, Shawn says that "doEndTag() is not > > necessarily > > called at the end of every invocation (in cases of abnormal > > termination -- > > e.g., an exception thrown inside a tag's body or by one of > > its methods)" > > If you want to clear up after each invocation, I think you > want doFinally() method on the interface TryCatchFinally? > > > But why the release() method isn't called between two uses of > > the same tag > > ?? > > > > Is it a performance issue ??? > > Presumably the release() method is intended to release > heavyweight objects used by the tag, so yes. > > Cheers, Simon > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Taglib on tomcat 4.1.24
> > > perhaps the new tomcat manager keep to much things in cache... > > Absolutely. Tag instances may be re-used. This means you can > > only do setup for your tag at the last minute in doStartTag(). > doStartTag ??? > isn't it doEndTag ?? Well, I meant "get things ready for your tag", not "clean up after" (as you seem to be implying) and I specifically meant "as opposed to in constructors, instance initialisers, property writers, etc". > But if I use the doEndTag, Shawn says that "doEndTag() is not > necessarily > called at the end of every invocation (in cases of abnormal > termination -- > e.g., an exception thrown inside a tag's body or by one of > its methods)" If you want to clear up after each invocation, I think you want doFinally() method on the interface TryCatchFinally? > But why the release() method isn't called between two uses of > the same tag > ?? > > Is it a performance issue ??? Presumably the release() method is intended to release heavyweight objects used by the tag, so yes. Cheers, Simon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Taglib on tomcat 4.1.24
doStartTag ??? isn't it doEndTag ?? If you release your properties at the end of the doStartTag, you can't use them in the body. But if I use the doEndTag, Shawn says that "doEndTag() is not necessarily called at the end of every invocation (in cases of abnormal termination -- e.g., an exception thrown inside a tag's body or by one of its methods)" I have the same problem than Pierre and didn't understand why. Now I know and I'll correct my taglibs. But why the release() method isn't called between two uses of the same tag ?? Is it a performance issue ??? Arnaud. > -Message d'origine- > De : Simon MacMullen [mailto:[EMAIL PROTECTED] > Envoyé : mardi 1 avril 2003 12:00 > À : Tomcat Users List > Objet : RE: Taglib on tomcat 4.1.24 > > > > perhaps the new tomcat manager keep to much things in cache... > > Absolutely. Tag instances may be re-used. This means you can > only do setup for your tag at the last minute in doStartTag(). > > See > > http://www.mail-archive.com/[EMAIL PROTECTED]/msg > 00846.html > > for more info, explained more articulately. > > Cheers, Simon > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Taglib on tomcat 4.1.24
> perhaps the new tomcat manager keep to much things in cache... Absolutely. Tag instances may be re-used. This means you can only do setup for your tag at the last minute in doStartTag(). See http://www.mail-archive.com/[EMAIL PROTECTED]/msg00846.html for more info, explained more articulately. Cheers, Simon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]