tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 46339] Recursive tag files with JspFragment attributes fails
Date Wed, 07 Jan 2009 01:56:54 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=46339


Kin-Man Chung <kin-man.chung@sun.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kin-man.chung@sun.com




--- Comment #3 from Kin-Man Chung <kin-man.chung@sun.com>  2009-01-06 17:56:52 PST ---
The proposed patch to synchronize tag variables to the outermost page context
will work for this program, but will fail in other cases.  Consider the case
where recursive.tag invokes foo.tag, passing another fragment.  It would be
wrong to synchronize the variables in foo.tag with the outermost page context
in this case, because that fragment is defined in foo.tag, and not index.jsp.

To fix this bug, the variable needs to be synchronized with the page context
that the fragment is created, before the fragment is invoked.  I propose to add
a parameter to org.apache.jasper.runtime.JspContextWrapper.syncBeforeInvoke().

    /**
     * Synchronize variables before fragment invokation
     * @param jspContext The Jsp context of the fragment
     */
    public void syncBeforeInvoke(JspContext jspContext) {
        copyTagToPageScope(jspContext, VariableInfo.NESTED);
        copyTagToPageScope(jspContext, VariableInfo.AT_BEGIN);
    }

I think we can safely leave the rest of JspContextWrapper the way it is.

Of course, Generator needs to be modified to get the JspContext from the
fragment and pass it to syncBeforeInvoke().

I'll submit a patch when I get around to it.  :-)

It would be nice for the spec to clarify this.  JSP.8.9.1 and Table JSP.8-6
will need to be updated.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message