Bug 6320

Summary: Scripting elements confuses the Core TLV
Product: Taglibs Reporter: Hans Bergsten <hans>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: CLOSED WORKSFORME    
Severity: blocker    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Hans Bergsten 2002-02-08 00:30:08 UTC
A scripting element in an element seem to mess up the TLV state and cause invalid
error message due to this. An example:

  <c:choose>
    <c:when test="1 == 1">
      <%= foo %>
      <c:set var="isValid" value="false" />
    </c:when>
  </c:choose>

This gives "Illegal child tag in "c:choose": "c:set". If I remove the scripting
element it works fine.
Comment 1 Shawn Bayern 2002-02-08 00:36:42 UTC
Thanks again for the report, Hans, but are you certain that you weren't 
validating a stale page or another part of the page than the fragment you 
listed?  I can't replicate the problem or see any reason for it glancing at the 
TLV code.  The following page, in toto, works for me in Tomcat 4.0.1:

 <%@ taglib prefix="c" uri="http://java.sun.com/jstl/ea/core" %>
 <% String foo = "bar"; %>
 <c:choose>
   <c:when test="1 == 1">
     <%= foo %>
     <c:set var="isValid" value="false" />
   </c:when>
 </c:choose>

Are you sure the error matches the code fragment?
Comment 2 Hans Bergsten 2002-02-08 00:50:16 UTC
Sorry, my bad. I had forgot that I had hacked versions of the TLVs in my web 
app ;-) My incorrect hack to fix the <jsp:useBean> problem caused the problem
I reported here. I'll update to your latest version as soon as the nightly
builds are done.