[
http://www.stripesframework.org/jira/browse/STS-618?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11554#action_11554
]
Frederic Daoud commented on STS-618:
------------------------------------
I've also had tag pooling-related problems with Resin. I verified that these
problems do not occur with Tomcat and Jetty.
Maybe I'm misunderstanding something, but when you say "shouldn't we be
cleaning them ourselves?", isn't that what we're doing by nulling the
properties of the tag after we're done? Isn't the problem the other way around,
that Resin isn't initializing the tag properly for each iteration of the loop?
Just to add some info, in my case, the problem occurs not when I have the tag
in a loop, but rather when I have more than one <stripes:option-collection> tag
in the same page. Probably the same end result. Resin sees that the label= and
name= properties are the same and thinks that it's appropriate to set them only
once.
Or maybe we /shouldn't/ be nulling the values? I don't know enough about the
intricacies of tag pooling to know the answer.
> options-collection tag is rendering incorrectly when inside the loop
> --------------------------------------------------------------------
>
> Key: STS-618
> URL: http://www.stripesframework.org/jira/browse/STS-618
> Project: Stripes
> Issue Type: Bug
> Components: Tag Library
> Affects Versions: Release 1.5
> Environment: JDK 1.6.0_07, Resin 3.1.2
> Reporter: Nick Yantikov
>
> Code in question (class InputOptionsCollectionTag, method doEndTag(), lines
> 345,346) :
> this.value = null;
> this.label = null;
> Problem description:
> I have the following JSP code:
> <c:forEach ...>
> ...
> <stripes:select ...>
> <stripes:options-collection collection="some_collection_here"
> label="name" value="id" />
> </stripes:select>
> ...
> </c:forEach>
> As a result of the JSP translation Resin generates the following java code:
> while (_jsp_iter_269.hasNext()) {
> ...skip...
> if (_jsp_InputOptionsCollectionTag_18 == null) {
> _jsp_InputOptionsCollectionTag_18 = new
> net.sourceforge.stripes.tag.InputOptionsCollectionTag();
> _jsp_InputOptionsCollectionTag_18.setPageContext(pageContext);
>
> _jsp_InputOptionsCollectionTag_18.setParent((javax.servlet.jsp.tagext.Tag)
> _jsp_InputSelectTag_17);
> _jsp_InputOptionsCollectionTag_18.setLabel("name");
> _jsp_InputOptionsCollectionTag_18.setValue("id");
> }
>
> _jsp_InputOptionsCollectionTag_18.setCollection(_caucho_expr_5.evalObject(_jsp_env));
> _jsp_InputOptionsCollectionTag_18.doStartTag();
> _jsp_InputOptionsCollectionTag_18.doEndTag();
> ...skip...
> }
> As you can see setLabel(), setValue() are only called once in the loop right
> after tag instance is lazily instantiated inside "if" statement.
> Once doEndTag() method is executed during the first iteration "value" and
> "label" properties are nulled and then the next iteration results in
> incorrect HTML rendering.
> Apparently Resin applies the same paradigm of tag initialization to every jsp
> tag, so this particular problem may potentially exist with other stripes's
> tags if they have similar "clean up" code at the end of the doEndTag().
> It appears that Stripes 1.4.3 does not have this problem and problem only
> appeared in 1.5
> I have not tested this particular test case with other web containers, and
> not sure if this sort of the "optimization" performed by Resin is
> appropriate, but on the other hand from the pure theoretical point of view
> since we do not control initialization of the tag properties shouldn't we be
> cleaning them ourselves?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development