Bugs item #742633, was opened at 2003-05-24 02:12
Message generated for change (Settings changed) made by starksm
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=742633&group_id=22866

Category: JBossWeb
Group: v3.2
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: roberto (rroberto)
Assigned to: Nobody/Anonymous (nobody)
Summary: JBOSS 3.2.1 / Jetty and Tag Support 

Initial Comment:
The servlet engine doesn't call the release method on 
tags every time is used from jsp pages.

This because a pool is used .

this is the servlet code generated from a jsp

....
private org.apache.jasper.runtime.TagHandlerPool 
_jspx_tagPool_ABSTag_CustomButton_xmlDocument_s
cope;
....
/* ---- ABSTag:CustomButton ---- */
com.dat.abs.web.tags.ABSCustomButtonTag 
_jspx_th_ABSTag_CustomButton_0 = 
(com.dat.abs.web.tags.ABSCustomButtonTag) 
_jspx_tagPool_ABSTag_CustomButton_xmlDocument_s
cope.get
(com.dat.abs.web.tags.ABSCustomButtonTag.class);
_jspx_th_ABSTag_CustomButton_0.setPageContext
(pageContext);
_jspx_th_ABSTag_CustomButton_0.setParent
(_jspx_th_ABSTag_ButtonBody_0);
_jspx_th_ABSTag_CustomButton_0.setXmlDocument
(vXmlDocument);
_jspx_th_ABSTag_CustomButton_0.setScope(vScope);
int _jspx_eval_ABSTag_CustomButton_0 = 
_jspx_th_ABSTag_CustomButton_0.doStartTag();
if (_jspx_th_ABSTag_CustomButton_0.doEndTag() == 
javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
return;
_jspx_tagPool_ABSTag_CustomButton_xmlDocument_s
cope.reuse(_jspx_th_ABSTag_CustomButton_0)

....

the method "reuse" on TagHandlerPool is..

/**
* Adds the given tag handler to this tag handler pool, 
unless this tag
* handler pool has already reached its capacity, in which 
case the tag
* handler's release() method is called.
*
* @param handler Tag handler to add to this tag handler 
pool
*/
public synchronized void reuse(Tag handler) {
if (current < (handlers.length - 1))
handlers[++current] = handler;
else
handler.release();
}


so only when handler pool has already reached its 
capacity the tag's release() method is called.

>From the sun javadoc about interface 
javax.servlet.jsp.tagext.Tag:

"Called on a Tag handler to release state. The page 
compiler guarantees that JSP page implementation 
objects will invoke this method on all tag handlers".


This cause that the global internal variable of the tag are 
not "clear". 
It's a jetty bug ? or i can't use internal variable (or i must 
reset it)
There is no problem this optional tag attributes, because 
a pool is created for each combination of tag/arguments 
passed.

ty
Roberto


----------------------------------------------------------------------

Comment By: Stefan Kuehnel (skuehnel)
Date: 2003-06-24 02:44

Message:
Logged In: YES 
user_id=596644

This is not a bug, but a misunderstanding of the tag life cycle. 
See http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16001 
for more details.


----------------------------------------------------------------------

Comment By: Wonne Keysers (wonnekeysers)
Date: 2003-06-18 06:41

Message:
Logged In: YES 
user_id=505480

I had similar problems for the jstl internationalization tags:
the 'fmt:bundle' tag is supposed to create a new 'translation 
context' only valid for nested fmt:message tags, but the 
context was never closed.

I managed to solve this problem after I added 
the 'enablePooling'-init parameter in jboss-
3.2.x\server\default\deploy\jbossweb-
jetty.sar\webdefault.xml:

<servlet>
  <servlet-name>jsp</servlet-name>
  <servlet-
class>org.apache.jasper.servlet.JspServlet</servlet-class>

  <init-param>
     <param-name>enablePooling</param-name>
     <param-value>false</param-value>
  </init-param>

  <load-on-startup>0</load-on-startup>
</servlet>


Wonne


----------------------------------------------------------------------

Comment By: Lance Warren Hankins (lhankins)
Date: 2003-06-05 12:16

Message:
Logged In: YES 
user_id=108347

This is definitely a bug (and a serious problem).   Its
caused me major pain in migrating our application from Jboss
3.0.4 to JBoss 3.2.1.   

The net effect of this problem is that many custom tags will
not work correctly (as they are being pooled, but never
re-initialized properly after first use). 

This can cause serious errors in the custom tags.   For
example, I have a custom tag that represents a Tabbed panel.
  It has one nested tag for each Tab.   For example :

      <epc:tabbedPanel name="process">
         <epc:tab name="general" displayName="General"
body="/content/process/attribute/processGeneralAttributes.jsp"/>
         <epc:tab name="docs" displayName="Documents"
body="/content/attribute/documents.jsp"/>
         <epc:tab name="tags" displayName="Tags"
body="/content/attribute/tags.jsp"/>
         <epc:tab name="version" displayName="Version"
body="/content/attribute/version.jsp"/>
         <epc:tab name="materials" displayName="Materials"
body="/content/process/attribute/processMaterialAttribute.jsp"/>
      </epc:tabbedPanel>

The tabbedPanel tag implementation keeps a list with all its
child tab definitions in it (the child tags add themselves
to their parent's list during their doStart method).

In the custom tag's release method, I clear the list.

When this tag is used with 3.2.1, it basically just keeps
expanding (keeps accumulating tabs), because release is
never called (so the list just keeps growing and growing).


----------------------------------------------------------------------

Comment By: Greg Wilkins (gregwilkins)
Date: 2003-06-01 15:17

Message:
Logged In: YES 
user_id=44062

I don't think this is not a jetty bug.  
I think it is a jakarta-jasper2 "feature".

I think there are some JspServlet init parameters that you can
use to change this behaviour (you'd have to check the jasper
mailing archives).  But I think you will find that the spec
will change in future to match jasper.

regards


----------------------------------------------------------------------

Comment By: Jan Bartel (janb)
Date: 2003-05-28 07:15

Message:
Logged In: YES 
user_id=45251

Roberto,

AFAIK, all jsp stuff is handled by JASPER, not Jetty itself.
This issue may be better off raised on the Jakarta Tomcat lists.

Jan

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=742633&group_id=22866


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to