You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2003/09/26 00:12:28 UTC

DO NOT REPLY [Bug 23425] New: - Invalid scoping of variables exported from TEI classes

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=23425>.
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=23425

Invalid scoping of variables exported from TEI classes

           Summary: Invalid scoping of variables exported from TEI classes
           Product: Tomcat 4
           Version: 4.1.24
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Jasper 2
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: ld_development@hotmail.com


I believe there is a scoping issue with Jasper with respect to variables 
exported from TEI implementations.  Specifically I am using the Struts <define> 
tag, which exports a variable marked as VariableInfo.AT_END.  Which according 
to the Spec: 
•AT_END, if the scripting variable is available after the end tag of the action
that defines it until the end of the scope.

However, in the scenario where the tag is used in 2 seperate scopes (within an 
if/else) the variable is not redefined in the second scope.  I believe that 
according to spec the second scope should recieve a new declaration of the 
exported var.  

I have included only examples of the problem and can provide more detail if the 
following does not sufficiently explain.

Example JSP - 
<%if (some boolean){%>
   <struts:define id="varName" ...../>
   ......
<%}else{%>
   <struts:define id="varName" ...../>
   ......
<%}%>

JSP compilation will fail in this scenario as the Jasper output would look 
something like:
if(same boolean value) {

/* ----  bean:define ---- */
          org.apache.struts.taglib.bean.DefineTag _jspx_th_bean_define_0 = new 
org.apache.struts.taglib.bean.DefineTag();
          _jspx_th_bean_define_0.setPageContext(pageContext);
          _jspx_th_bean_define_0.setParent(_jspx_parent tag);
          _jspx_th_bean_define_0.setId("varName");
          _jspx_th_bean_define_0.setName("...");
          _jspx_th_bean_define_0.setProperty("...");
          _jspx_th_bean_define_0.setType("java.lang.String");
          int _jspx_eval_bean_define_0 = _jspx_th_bean_define_0.doStartTag();
          if (_jspx_th_bean_define_0.doEndTag() == 
javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
            return;
          java.lang.String propertyname = null;
          propertyname = (java.lang.String) pageContext.findAttribute
("varName");

......

} else {
 /* ----  bean:define ---- */
          org.apache.struts.taglib.bean.DefineTag _jspx_th_bean_define_1 = new 
org.apache.struts.taglib.bean.DefineTag();
          _jspx_th_bean_define_1.setPageContext(pageContext);
          _jspx_th_bean_define_1.setParent(_jspx_parent tag);
          _jspx_th_bean_define_1.setId("varName");
          _jspx_th_bean_define_1.setName("...");
          _jspx_th_bean_define_1.setProperty("...");
          _jspx_th_bean_define_1.setType("java.lang.String");
          int _jspx_eval_bean_define_1 = _jspx_th_bean_define_1.doStartTag();
          if (_jspx_th_bean_define_1.doEndTag() == 
javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
            return;
          propertyname = (java.lang.String) pageContext.findAttribute
("varName"); //compilation fails here//
.......

}

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