DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22133>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22133

Scoping conflict for generated fragment helpers

           Summary: Scoping conflict for generated fragment helpers
           Product: Tomcat 5
           Version: 5.0.6
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Jasper2
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


A JSP Fragment in a tag file that does EL may lead to problematic Java code.

JSP Fragments of tag files are compiled into inner classes:

  public final class com_coremedia_jsp_NewsTicker_body_tag
    extends javax.servlet.jsp.tagext.SimpleTagSupport
  {
    ...

    private class com_coremedia_jsp_NewsTicker_body_tagHelper
      extends org.apache.jasper.runtime.JspFragmentHelper
    {
      ...
      public void invoke0( java.io.Writer out ) 
        throws Throwable
      {
         ...
        
out.write((java.lang.String)org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${rows}",
java.lang.String.class, (PageContext)getJspContext(), null, false)); <<<<<<
         ...
      }
    }

Both javac 1.3 and Eclipse's JDT compiler flag the call to #getJspContext as
invalid as this method is both inherited and defined in the enclosing class: 

  com_coremedia_jsp_NewsTicker_body_tag.java:206: getJspContext() is inherited  
  from org.apache.jasper.runtime.JspFragmentHelper and hides method in outer  
  class org.apache.jsp.tag.web.com_coremedia_jsp_NewsTicker_body_tag.  An  
  explicit 'this' qualifier must be used to select the desired instance.

Javac 1.4.2 accepts this code and calls the inherited method.

>From my interpretation of the JLS, 1.4.2's behaviour seems correct and is the
intended one, but the code won't be compilable with javac 1.3.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to