RE: tag reuse, setParent and findAncestorWithClass
Thanks Tim, I got it working! -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 07, 2004 10:07 AM To: Tomcat Users List Subject: Re: tag reuse, setParent and findAncestorWithClass Turn off tag pooling. -Tim Justin Kennedy wrote: > Hi Tim, > > I read through the link you posted but I don't see any references to > setParent. I understand that setParent is only called once when the > attributes for a tag are the same (because it's reused), so how should I > go about developing the inner tag so the parent will always be set? I > read up on SimpleTag and that could be the answer, but I'm worried about > performance with this because the writevalue tag is called many many > times on one page. > > Thanksk > > -Original Message- > From: Tim Funk [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 07, 2004 7:59 AM > To: Tomcat Users List > Subject: Re: tag reuse, setParent and findAncestorWithClass > > http://jakarta.apache.org/tomcat/faq/misc.html#tagbroken > > -tim > > Justin Kennedy wrote: > >>Hi, >> >> >> >>I'm upgrading our tag library to Tomcat 5 and having problems. Note > > that > >>they were written back in JSP 1.1 and haven't changed for a few years. >> >> >> >>The problem looks like the tags are being cached and the setParent > > isn't > >>being called for each new "reuse". As a result the wrong tag is > > returned > >>from findAncestorWithClass when the WriteValueTag is re-used in a >>different nested block. Maybe this is how the spec was designed and I >>just don't know the right way to code the tags. Anyway here's what the >>JSP page looks like (note: transacttag issues a call to the database. >>Writevaluetag writes the value of a column from the data returned from >>transacttag. If 'transactId' isn't passed to WriteValueTag, it will > > use > >>the findAncestorWithClass to find the enclosing IterateTag to > > determine > >>the transactId): >> >> >> >> >> >> >> >> >> >>a - >> >> >> >> > value='<%= > >>tmpuiid %>'/> >> >> >> >> >> >> >> >> >> >>#1 - >> >>#2 - >column="FORM_NAME"/> >> >>#3 - >> >> >> >> >> >> >> >> >> >> >> >> >> >>The problems: >> >>1.UI_NAME in #1 is a column from the first "uis" transactTag. The >>writeValueTag prints out the value of this column but it shouldn't >>behave this way because it's enclosed IterateTag has a different >>"transactId". I put this here to demonstrate the problem >>2.FORM_NAME in #3 is a column in the second transactTag of "ui". >>This column value SHOULD be output (like it has always done) because > > the > >>enclosed iterateTag specifies the proper transactId, but this value is >>not output because it's parent is set to the first IterateTag and not >>the second, hence the different transactIds. >> >> >> >>#2 works only because I'm explicitly setting the transactId. >> >> >> >>The WriteValueTag extends the TagSupport class and everything is done > > in > >>the doStartTag event. >> - 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: tag reuse, setParent and findAncestorWithClass
Tim, I added this to my tomcat_home/conf/web.xml: jsp org.apache.jasper.servlet.JspServlet enablePooling false I put it right after: But I still see the same behavior. Note: This setting is not overridden in the web.xml for my webapp... I tried putting it there too but no luck. Thanks -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 07, 2004 10:07 AM To: Tomcat Users List Subject: Re: tag reuse, setParent and findAncestorWithClass Turn off tag pooling. -Tim Justin Kennedy wrote: > Hi Tim, > > I read through the link you posted but I don't see any references to > setParent. I understand that setParent is only called once when the > attributes for a tag are the same (because it's reused), so how should I > go about developing the inner tag so the parent will always be set? I > read up on SimpleTag and that could be the answer, but I'm worried about > performance with this because the writevalue tag is called many many > times on one page. > > Thanksk > > -Original Message- > From: Tim Funk [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 07, 2004 7:59 AM > To: Tomcat Users List > Subject: Re: tag reuse, setParent and findAncestorWithClass > > http://jakarta.apache.org/tomcat/faq/misc.html#tagbroken > > -tim > > Justin Kennedy wrote: > >>Hi, >> >> >> >>I'm upgrading our tag library to Tomcat 5 and having problems. Note > > that > >>they were written back in JSP 1.1 and haven't changed for a few years. >> >> >> >>The problem looks like the tags are being cached and the setParent > > isn't > >>being called for each new "reuse". As a result the wrong tag is > > returned > >>from findAncestorWithClass when the WriteValueTag is re-used in a >>different nested block. Maybe this is how the spec was designed and I >>just don't know the right way to code the tags. Anyway here's what the >>JSP page looks like (note: transacttag issues a call to the database. >>Writevaluetag writes the value of a column from the data returned from >>transacttag. If 'transactId' isn't passed to WriteValueTag, it will > > use > >>the findAncestorWithClass to find the enclosing IterateTag to > > determine > >>the transactId): >> >> >> >> >> >> >> >> >> >>a - >> >> >> >> > value='<%= > >>tmpuiid %>'/> >> >> >> >> >> >> >> >> >> >>#1 - >> >>#2 - >column="FORM_NAME"/> >> >>#3 - >> >> >> >> >> >> >> >> >> >> >> >> >> >>The problems: >> >>1.UI_NAME in #1 is a column from the first "uis" transactTag. The >>writeValueTag prints out the value of this column but it shouldn't >>behave this way because it's enclosed IterateTag has a different >>"transactId". I put this here to demonstrate the problem >>2.FORM_NAME in #3 is a column in the second transactTag of "ui". >>This column value SHOULD be output (like it has always done) because > > the > >>enclosed iterateTag specifies the proper transactId, but this value is >>not output because it's parent is set to the first IterateTag and not >>the second, hence the different transactIds. >> >> >> >>#2 works only because I'm explicitly setting the transactId. >> >> >> >>The WriteValueTag extends the TagSupport class and everything is done > > in > >>the doStartTag event. >> - 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: tag reuse, setParent and findAncestorWithClass
Turn off tag pooling. -Tim Justin Kennedy wrote: Hi Tim, I read through the link you posted but I don't see any references to setParent. I understand that setParent is only called once when the attributes for a tag are the same (because it's reused), so how should I go about developing the inner tag so the parent will always be set? I read up on SimpleTag and that could be the answer, but I'm worried about performance with this because the writevalue tag is called many many times on one page. Thanksk -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 07, 2004 7:59 AM To: Tomcat Users List Subject: Re: tag reuse, setParent and findAncestorWithClass http://jakarta.apache.org/tomcat/faq/misc.html#tagbroken -tim Justin Kennedy wrote: Hi, I'm upgrading our tag library to Tomcat 5 and having problems. Note that they were written back in JSP 1.1 and haven't changed for a few years. The problem looks like the tags are being cached and the setParent isn't being called for each new "reuse". As a result the wrong tag is returned from findAncestorWithClass when the WriteValueTag is re-used in a different nested block. Maybe this is how the spec was designed and I just don't know the right way to code the tags. Anyway here's what the JSP page looks like (note: transacttag issues a call to the database. Writevaluetag writes the value of a column from the data returned from transacttag. If 'transactId' isn't passed to WriteValueTag, it will use the findAncestorWithClass to find the enclosing IterateTag to determine the transactId): a - value='<%= tmpuiid %>'/> #1 - #2 - #3 - The problems: 1. UI_NAME in #1 is a column from the first "uis" transactTag. The writeValueTag prints out the value of this column but it shouldn't behave this way because it's enclosed IterateTag has a different "transactId". I put this here to demonstrate the problem 2. FORM_NAME in #3 is a column in the second transactTag of "ui". This column value SHOULD be output (like it has always done) because the enclosed iterateTag specifies the proper transactId, but this value is not output because it's parent is set to the first IterateTag and not the second, hence the different transactIds. #2 works only because I'm explicitly setting the transactId. The WriteValueTag extends the TagSupport class and everything is done in the doStartTag event. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tag reuse, setParent and findAncestorWithClass
Hi Tim, I read through the link you posted but I don't see any references to setParent. I understand that setParent is only called once when the attributes for a tag are the same (because it's reused), so how should I go about developing the inner tag so the parent will always be set? I read up on SimpleTag and that could be the answer, but I'm worried about performance with this because the writevalue tag is called many many times on one page. Thanksk -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 07, 2004 7:59 AM To: Tomcat Users List Subject: Re: tag reuse, setParent and findAncestorWithClass http://jakarta.apache.org/tomcat/faq/misc.html#tagbroken -tim Justin Kennedy wrote: > Hi, > > > > I'm upgrading our tag library to Tomcat 5 and having problems. Note that > they were written back in JSP 1.1 and haven't changed for a few years. > > > > The problem looks like the tags are being cached and the setParent isn't > being called for each new "reuse". As a result the wrong tag is returned > from findAncestorWithClass when the WriteValueTag is re-used in a > different nested block. Maybe this is how the spec was designed and I > just don't know the right way to code the tags. Anyway here's what the > JSP page looks like (note: transacttag issues a call to the database. > Writevaluetag writes the value of a column from the data returned from > transacttag. If 'transactId' isn't passed to WriteValueTag, it will use > the findAncestorWithClass to find the enclosing IterateTag to determine > the transactId): > > > > > > > > > > a - > > > > > > > > > > > > > > #1 - > > #2 - column="FORM_NAME"/> > > #3 - > > > > > > > > > > > > > > The problems: > > 1.UI_NAME in #1 is a column from the first "uis" transactTag. The > writeValueTag prints out the value of this column but it shouldn't > behave this way because it's enclosed IterateTag has a different > "transactId". I put this here to demonstrate the problem > 2.FORM_NAME in #3 is a column in the second transactTag of "ui". > This column value SHOULD be output (like it has always done) because the > enclosed iterateTag specifies the proper transactId, but this value is > not output because it's parent is set to the first IterateTag and not > the second, hence the different transactIds. > > > > #2 works only because I'm explicitly setting the transactId. > > > > The WriteValueTag extends the TagSupport class and everything is done in > the doStartTag event. > > - 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: tag reuse, setParent and findAncestorWithClass
http://jakarta.apache.org/tomcat/faq/misc.html#tagbroken -tim Justin Kennedy wrote: Hi, I'm upgrading our tag library to Tomcat 5 and having problems. Note that they were written back in JSP 1.1 and haven't changed for a few years. The problem looks like the tags are being cached and the setParent isn't being called for each new "reuse". As a result the wrong tag is returned from findAncestorWithClass when the WriteValueTag is re-used in a different nested block. Maybe this is how the spec was designed and I just don't know the right way to code the tags. Anyway here's what the JSP page looks like (note: transacttag issues a call to the database. Writevaluetag writes the value of a column from the data returned from transacttag. If 'transactId' isn't passed to WriteValueTag, it will use the findAncestorWithClass to find the enclosing IterateTag to determine the transactId): a - #1 - #2 - #3 - The problems: 1. UI_NAME in #1 is a column from the first "uis" transactTag. The writeValueTag prints out the value of this column but it shouldn't behave this way because it's enclosed IterateTag has a different "transactId". I put this here to demonstrate the problem 2. FORM_NAME in #3 is a column in the second transactTag of "ui". This column value SHOULD be output (like it has always done) because the enclosed iterateTag specifies the proper transactId, but this value is not output because it's parent is set to the first IterateTag and not the second, hence the different transactIds. #2 works only because I'm explicitly setting the transactId. The WriteValueTag extends the TagSupport class and everything is done in the doStartTag event. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]