2010/2/15 Mark Thomas <ma...@apache.org>:
> On 14/02/2010 06:47, kkoli...@apache.org wrote:
>> +    2. isImplemetedAsFragment() method is wrong.
>> +       1) A fragment can also be created with <jsp:attribute> when calling 
>> a tag,
>> +         when the attribute is declared being of type JspFragment.
>> +         -see JSP.5.10 <jsp:attribute>, or the places where the following 
>> method is called:
>> +         Generator#GeneratorVisitor#generateJspFragment(Node, String)
>> +
>> +       2) It should navigate up the parents chain. The SimpleTag can be one
>> +         of our parents, not necessary the immediate one.
> The name might be wrong. usesFragmentHelper might be better as that is
> actually what matters and it should be using the exact same logic as
> Generator to determine if a fragment helper is being used. If that isn't
> the case then there is a bug.
>

A JspFragment has its own scope of local variables. Thus, effectively
it should start with an empty map in
ScriptingVariableVisitor#scriptVars.  The usesFragmentHelper method
performs as if ScriptingVariableVisitor#scriptVars were empty, but
only for that very tag that caused that JspFragment to appear. Once we
try to nest a classic tag in it, it fails.

In r910395.I added a test that demonstrates that.  The alternative patch,
https://issues.apache.org/bugzilla/show_bug.cgi?id=48616#c20
does work here.


Best regards,
Konstantin Kolinko

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

Reply via email to