Bug 22420

Summary: Multiple nested standard tags for flow control not parsing under weblogic
Product: Taglibs Reporter: Mark Cheek <mark.cheek>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P3    
Version: 1.0   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description Mark Cheek 2003-08-14 14:21:54 UTC
Using a localhost unit testing configuration, 
with:
Win2k professional os
jdk131_06
Weblogic server 7.0

Tried the following page (the page has been simplified for testing, with simple 
set variables for test conditions and values dependent upon the form we are 
using. 

Got the following error consistently: 
[ServletException in:/common/page/ownerInfoSummary.jsp] Could not complete 
parsing, unmatched tags: if otherwise when choose if forEach if ' 

I also recieved very similar parsing errors (parser not recognizing completed 
tag pairs, despite correct syntax)

I also tried using different tags ( c:choose with when and otherwise, etc. ) 
and got similar results.  It seems if I make the page too complex or nest too 
much logic, the parser gets really cranky.

Am I using incorrect syntax, or is this something with the taglib or the parser?
  


<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/clt.tld" prefix="clt" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>


<%-- variable used to tell us how many owners we have in the current list --%>
<c:set var="maxOwners" value="0"/>

<%-- used to simulate some conditions we are testing for --%>
<c:set var="testCond1" value="false"/>
<c:set var="testCond2" value="true"/>
<%-- these simulate variables referenced from our form --%>
<c:set var="var1" value="1" />
<c:set var="var2" value="2" />
<table border="0" cellspacing="0" cellpadding="0" width="100%">
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="3%">&nbsp;</td>
    <td width="95%">Some Text</td>
    <td width="2%">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>
      <table>
	<%-- Title row, defines spacing --%>
	<tr>
	  <td width="150px">NAME</td>
	  <td width="10px"></td>
	  <td>% Ownership</td>
	  <td width="10px"></td>
	  <td></td>
	  <td width="10px"></td>
	  <td></td>
	</tr>
	<tr height="10px">
	  <td colspan="7"><hr></td>                         
	</tr>
	<%-- Simulated test condition checking for empty info, for simplicity 
setting to false --%>
	<c:if test="${testCond1}" >
	<tr>
	  <td colspan="7">No owner information entered. </td>       
	</tr>
	</c:if >
	
	<%-- iterate through information we can have 0 -8 may want to just 
access the collection directly in forEach --%>
	<c:forEach begin="0" end="8"  var="current">              
	<%-- test to make sure we have valid data in this row to display 
setting to true for simplicity --%>
	<c:if test="${testCond2}" >
	<tr>
    <c:choose >
    <c:when test="${(current % 2) == 0}" >
	    <td><c:out value="${var1}" /></td><td></td><c:out 
value="${var1}" /></td><td colspan="4"></td>
    </c:when >
    <c:otherwise >
	    <td><c:out value="${var1}" /></td><td></td><c:out 
value="${var1}" /></td><td colspan="4"></td>
    </c:otherwise >
    </c:choose >
  </tr> 
	  <c:set var="maxOwners" value="${current +1}" />
	</tr>
	</c:if >
	</c:forEach >
    <tr>
        <td colspan="7" ><hr /> </td>
    </tr>
	<%-- if we have all nine owner information slots specified, dont allow 
them to add in a new user --%>
	<c:if test="${maxOwners < 10}" >
	<tr>
    <td colspan="4" ></td>
	  <td colspan="3">
	    <c:out value="${maxOwners}" />
	  </td>
	</tr>
	</c:if >
      </table>
    </td>
    <td>&nbsp;</td>
  </tr>        
</table>
Comment 1 Felipe Leme 2003-08-22 05:12:35 UTC
Hi Mark,

I tried your test case in my configuration (Tomcat 4.1.24 and JSTL 1.0.3) and it
worked fine. The result was:

 	Some Text  	 
  	111111111
NAME 		% Ownership 				
1		
1		
1		
1		
1		
1		
1		
1		
1		
	9


Are you using the latest JSTL version (1.0.3)? If you are, then this is probably
a Weblogic bug.


Felipe
Comment 2 Pierre Delisle 2003-08-22 16:43:08 UTC
I tested this too with Tomcat 4.1.24 and JSTL 1.0.3, and
just like Felipe all worked fine.