You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tiles.apache.org by "Zach Bailey (JIRA)" <ji...@apache.org> on 2008/12/16 17:01:37 UTC

[jira] Commented: (TILES-339) JSP tags do not reset attributes when reused

    [ https://issues.apache.org/struts/browse/TILES-339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45276#action_45276 ] 

Zach Bailey commented on TILES-339:
-----------------------------------

I am thinking of the following modifications:

# Add an abstract TilesTag and TilesBodyTag which extend TagSupport and BodyTagSupport and both implement TryCatchFinally.
# Existing tag classes which extend TagSupport will now extend TilesTag. Existing tag classes which extend BodyTagSupport will extend TilesBodyTag.
# Both TilesTag and TilesBodyTag will implement doCatch() in the following manner:

public void doCatch(Throwable throwable) throws Throwable {
        throw throwable;
    }

This is a default (no-op) implementation and will result in no change in handling exceptions thrown from tags.

# Both TilesTag and TilesBodyTag will implement doFinally in the following manner:

public void doFinally() {
        //reset any per-invocation resources
        reset();
    }

# TilesTag and TilesBodyTag will now define the reset method:

    /**
     * Resets the state of the tag, preparing it for another invocation.
     * Called every invocation after doEndTag via {@link TryCatchFinally#doFinally()}. 
     */
    protected void reset() { }

# The release() method will be defined as follows on TilesTag and TilesBodyTag:

/**
     * Release all allocated resources.
     */
    @Override
    public void release() {
        reset();
    }

# All logic found in existing release() methods will be moved to the reset() method and the release() methods removed.

Does anyone see any pitfalls or problems with this approach, or see a better way to resolve this issue?

> JSP  tags do not reset attributes when reused
> ---------------------------------------------
>
>                 Key: TILES-339
>                 URL: https://issues.apache.org/struts/browse/TILES-339
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-jsp (jsp support)
>    Affects Versions: 2.0.6, 2.1.0
>            Reporter: Antonio Petrelli
>            Priority: Blocker
>
> It is simply a misinterpretation of the Tag.release method:
> http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/tagext/Tag.html#release()
> Attribute reset must be done in the "doEndTag"!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.