You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by Pete Gordon <PG...@fourthchannel.com> on 2002/06/06 20:32:06 UTC

Jsp compilation of nested custom tags (porting from weblogic 6 to tomcat 4.0.3)

There is a problem with compiling the genenerated java code
(htmlGlobalAttribSearch$jsp.java) it tells me that variables have already
been defined.  I have compiled the source file and even created a test
HelloWorld.java to test it.  It is correct variables have already been
defined, which we found strange as far as the scope variables were
accessible, see the code below....

public class HelloWorld{
	public static void main(String args[]){
		do{
			int i = 5;
			do{
				int i=10;
			}while(false);
		}while(false);
	}
}

The JSP page has several nested custom tags (the same tags) and this is
working on weblogic 6.  But the generated java file from tomcat/jasper does
not compile.  The problem is the <fci:collection> tag being nested a few
times within itself.  See the JSP below.  I think this is a problem with the
jspc generated java code.  Am I way off base?

Thanks,
Pete Gordon

<%@ taglib uri="fciTagLib.tld" prefix = "fci" %>
<%@ page import="com.fci.arch.service.*"%>

<form action="<fci:get resource="site"/>" method="GET" id=form1 name=form1>
<input type="hidden" name="action" value="catalogActions.globalParametric">
<input type="hidden" name="searchPerfomed" value="true">

<table width="<fci:get resource="catNavWidth"/>" cellspacing="2"
cellpadding="2" border="0">
<tr>
	<td><fci:get resource="Parametric.Instructions"/></td>
</tr>
<fci:collection name="globalAttributeSearchDetail">
	<fci:collection name="pSearchAttributeType" cacheLevel="none">
	<tr>
		<td>
			<fci:get resource="Prefix.Content"/>
			<fci:element name="Name"/>
			<br>
			<select name="<fci:element name="Name"/>">
				<option value="~all~">all</option>
				<fci:collection name="globalAttributeValues"
cacheLevel="none">
					<% String value =
((Agent)pageContext.getAttribute("pSearchAttributeType.currentDO")).getPrope
rty("Name").toString(); %>
					<fci:element name="Value"
format="option" compare="<%= value %>"/>
				</fci:collection>
			</select>
			<fci:get resource="Suffix.Content"/>
		</td>
	</tr>
	</fci:collection>
</fci:collection>
<fci:nonempty collection="globalAttributeSearchDetail">
<tr>
	<td align="left">
		<br><fci:get resource="Button.AttributeSearch"/>
	</td>
</tr>
</fci:nonempty>
</table>
</form>




Re: Jsp compilation of nested custom tags (porting from weblogic 6 to tomcat 4.0.3)

Posted by Pete Gordon <PG...@fourthchannel.com>.
Thanks, Shawn.

Let me summarize for the tomcat-dev list.  I have an existing 
application with custom tags that runs on weblogic 6, when porting it 
over to Tomcat I now am running into an error where the generated java 
from a jsp with self nested tags will not compile, the code generated 
from jspc simulates the HelloWorld sample below, which is not valid java

code--it would be valid in C, but that's another story.

The first htmlGlobalAttribSearch$jsp.java compile error is line 198, 
variable lOffset is already defined.  There are several (19) more errors

like this that are also outputed from trying to compile the $jsp.java 
file that I have attached.

public class HelloWorld{
	public static void main(String args[]){
		do{
			int i = 5;
			do{
				int i=10;
			}while(false);
		}while(false);
	}
}

Tomorrow, I will try to create a minimal nested tag example and see if I

can duplicate the problem.  Unless someone is aware of this problem 
already, and can save me the effort.

Thanks,
Pete Gordon



On Thursday, June 6, 2002, at 03:03 PM, Shawn Bayern wrote:

> Hi Pete,
>
> If this is a Tomcat bug, it would be better to mail tomcat-dev about
it 
> or
> to submit a Tomcat bug report in Apache's Bugzilla
> (http://nagoya.apache.org/bugzilla).  I'd be happy to take a look at
it
> myself, but it's difficult to identify the problem in a large compiled
> servlet.  (I can't attempt to compile it myself since it depends on
some
> custom classes not included.)  If you could post the compilation
error,
> that'd definitely help us determine whether it looks like a Tomcat bug

> or
> not.



From: Pete Gordon <PG...@fourthchannel.com>
Date: Thu Jun 06, 2002  02:32:06 PM US/Eastern
To: 'Tag Libraries Developers List' <ta...@jakarta.apache.org>
Subject: Jsp compilation of nested custom tags (porting from weblogic 6 
to tomcat 4.0.3)
Reply-To: "Tag Libraries Developers List" <taglibs-
dev@jakarta.apache.org>

There is a problem with compiling the genenerated java code
(htmlGlobalAttribSearch$jsp.java) it tells me that variables have
already
been defined.  I have compiled the source file and even created a test
HelloWorld.java to test it.  It is correct variables have already been
defined, which we found strange as far as the scope variables were
accessible, see the code below....

public class HelloWorld{
	public static void main(String args[]){
		do{
			int i = 5;
			do{
				int i=10;
			}while(false);
		}while(false);
	}
}

The JSP page has several nested custom tags (the same tags) and this is
working on weblogic 6.  But the generated java file from tomcat/jasper 
does
not compile.  The problem is the <fci:collection> tag being nested a few
times within itself.  See the JSP below.  I think this is a problem with

the
jspc generated java code.  Am I way off base?

Thanks,
Pete Gordon

<%@ taglib uri="fciTagLib.tld" prefix = "fci" %>
<%@ page import="com.fci.arch.service.*"%>

<form action="<fci:get resource="site"/>" method="GET" id=form1 
name=form1>
<input type="hidden" name="action" 
value="catalogActions.globalParametric">
<input type="hidden" name="searchPerfomed" value="true">

<table width="<fci:get resource="catNavWidth"/>" cellspacing="2"
cellpadding="2" border="0">
<tr>
	<td><fci:get resource="Parametric.Instructions"/></td>
</tr>
<fci:collection name="globalAttributeSearchDetail">
	<fci:collection name="pSearchAttributeType" cacheLevel="none">
	<tr>
		<td>
			<fci:get resource="Prefix.Content"/>
			<fci:element name="Name"/>
			<br>
			<select name="<fci:element name="Name"/>">
				<option value="~all~">all</option>
				<fci:collection
name="globalAttributeValues"
cacheLevel="none">
					<% String value =
((Agent)pageContext.getAttribute("pSearchAttributeType.currentDO")).getP
rope
rty("Name").toString(); %>
					<fci:element name="Value"
format="option" compare="<%= value %>"/>
				</fci:collection>
			</select>
			<fci:get resource="Suffix.Content"/>
		</td>
	</tr>
	</fci:collection>
</fci:collection>
<fci:nonempty collection="globalAttributeSearchDetail">
<tr>
	<td align="left">
		<br><fci:get resource="Button.AttributeSearch"/>
	</td>
</tr>
</fci:nonempty>
</table>
</form>




<File attached: htmlGlobalAttribSearch$jsp.java>--

 


Re: Jsp compilation of nested custom tags (porting from weblogic 6 to tomcat 4.0.3)

Posted by Pete Gordon <PG...@fourthchannel.com>.
Thanks, Shawn.

Let me summarize for the tomcat-dev list.  I have an existing 
application with custom tags that runs on weblogic 6, when porting it 
over to Tomcat I now am running into an error where the generated java 
from a jsp with self nested tags will not compile, the code generated 
from jspc simulates the HelloWorld sample below, which is not valid java

code--it would be valid in C, but that's another story.

The first htmlGlobalAttribSearch$jsp.java compile error is line 198, 
variable lOffset is already defined.  There are several (19) more errors

like this that are also outputed from trying to compile the $jsp.java 
file that I have attached.

public class HelloWorld{
	public static void main(String args[]){
		do{
			int i = 5;
			do{
				int i=10;
			}while(false);
		}while(false);
	}
}

Tomorrow, I will try to create a minimal nested tag example and see if I

can duplicate the problem.  Unless someone is aware of this problem 
already, and can save me the effort.

Thanks,
Pete Gordon



On Thursday, June 6, 2002, at 03:03 PM, Shawn Bayern wrote:

> Hi Pete,
>
> If this is a Tomcat bug, it would be better to mail tomcat-dev about
it 
> or
> to submit a Tomcat bug report in Apache's Bugzilla
> (http://nagoya.apache.org/bugzilla).  I'd be happy to take a look at
it
> myself, but it's difficult to identify the problem in a large compiled
> servlet.  (I can't attempt to compile it myself since it depends on
some
> custom classes not included.)  If you could post the compilation
error,
> that'd definitely help us determine whether it looks like a Tomcat bug

> or
> not.



From: Pete Gordon <PG...@fourthchannel.com>
Date: Thu Jun 06, 2002  02:32:06 PM US/Eastern
To: 'Tag Libraries Developers List' <ta...@jakarta.apache.org>
Subject: Jsp compilation of nested custom tags (porting from weblogic 6 
to tomcat 4.0.3)
Reply-To: "Tag Libraries Developers List" <taglibs-
dev@jakarta.apache.org>

There is a problem with compiling the genenerated java code
(htmlGlobalAttribSearch$jsp.java) it tells me that variables have
already
been defined.  I have compiled the source file and even created a test
HelloWorld.java to test it.  It is correct variables have already been
defined, which we found strange as far as the scope variables were
accessible, see the code below....

public class HelloWorld{
	public static void main(String args[]){
		do{
			int i = 5;
			do{
				int i=10;
			}while(false);
		}while(false);
	}
}

The JSP page has several nested custom tags (the same tags) and this is
working on weblogic 6.  But the generated java file from tomcat/jasper 
does
not compile.  The problem is the <fci:collection> tag being nested a few
times within itself.  See the JSP below.  I think this is a problem with

the
jspc generated java code.  Am I way off base?

Thanks,
Pete Gordon

<%@ taglib uri="fciTagLib.tld" prefix = "fci" %>
<%@ page import="com.fci.arch.service.*"%>

<form action="<fci:get resource="site"/>" method="GET" id=form1 
name=form1>
<input type="hidden" name="action" 
value="catalogActions.globalParametric">
<input type="hidden" name="searchPerfomed" value="true">

<table width="<fci:get resource="catNavWidth"/>" cellspacing="2"
cellpadding="2" border="0">
<tr>
	<td><fci:get resource="Parametric.Instructions"/></td>
</tr>
<fci:collection name="globalAttributeSearchDetail">
	<fci:collection name="pSearchAttributeType" cacheLevel="none">
	<tr>
		<td>
			<fci:get resource="Prefix.Content"/>
			<fci:element name="Name"/>
			<br>
			<select name="<fci:element name="Name"/>">
				<option value="~all~">all</option>
				<fci:collection
name="globalAttributeValues"
cacheLevel="none">
					<% String value =
((Agent)pageContext.getAttribute("pSearchAttributeType.currentDO")).getP
rope
rty("Name").toString(); %>
					<fci:element name="Value"
format="option" compare="<%= value %>"/>
				</fci:collection>
			</select>
			<fci:get resource="Suffix.Content"/>
		</td>
	</tr>
	</fci:collection>
</fci:collection>
<fci:nonempty collection="globalAttributeSearchDetail">
<tr>
	<td align="left">
		<br><fci:get resource="Button.AttributeSearch"/>
	</td>
</tr>
</fci:nonempty>
</table>
</form>




<File attached: htmlGlobalAttribSearch$jsp.java>--

 


Re: Jsp compilation of nested custom tags (porting from weblogic 6 to tomcat 4.0.3)

Posted by Shawn Bayern <ba...@essentially.net>.
Hi Pete,

If this is a Tomcat bug, it would be better to mail tomcat-dev about it or
to submit a Tomcat bug report in Apache's Bugzilla
(http://nagoya.apache.org/bugzilla).  I'd be happy to take a look at it
myself, but it's difficult to identify the problem in a large compiled
servlet.  (I can't attempt to compile it myself since it depends on some
custom classes not included.)  If you could post the compilation error,
that'd definitely help us determine whether it looks like a Tomcat bug or
not.

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com
(coming in July 2002 from Manning Publications)

On Thu, 6 Jun 2002, Pete Gordon wrote:

> There is a problem with compiling the genenerated java code
> (htmlGlobalAttribSearch$jsp.java) it tells me that variables have already
> been defined.  I have compiled the source file and even created a test
> HelloWorld.java to test it.  It is correct variables have already been
> defined, which we found strange as far as the scope variables were
> accessible, see the code below....
> 
> public class HelloWorld{
> 	public static void main(String args[]){
> 		do{
> 			int i = 5;
> 			do{
> 				int i=10;
> 			}while(false);
> 		}while(false);
> 	}
> }
> 
> The JSP page has several nested custom tags (the same tags) and this is
> working on weblogic 6.  But the generated java file from tomcat/jasper does
> not compile.  The problem is the <fci:collection> tag being nested a few
> times within itself.  See the JSP below.  I think this is a problem with the
> jspc generated java code.  Am I way off base?
> 
> Thanks,
> Pete Gordon
> 
> <%@ taglib uri="fciTagLib.tld" prefix = "fci" %>
> <%@ page import="com.fci.arch.service.*"%>
> 
> <form action="<fci:get resource="site"/>" method="GET" id=form1 name=form1>
> <input type="hidden" name="action" value="catalogActions.globalParametric">
> <input type="hidden" name="searchPerfomed" value="true">
> 
> <table width="<fci:get resource="catNavWidth"/>" cellspacing="2"
> cellpadding="2" border="0">
> <tr>
> 	<td><fci:get resource="Parametric.Instructions"/></td>
> </tr>
> <fci:collection name="globalAttributeSearchDetail">
> 	<fci:collection name="pSearchAttributeType" cacheLevel="none">
> 	<tr>
> 		<td>
> 			<fci:get resource="Prefix.Content"/>
> 			<fci:element name="Name"/>
> 			<br>
> 			<select name="<fci:element name="Name"/>">
> 				<option value="~all~">all</option>
> 				<fci:collection name="globalAttributeValues"
> cacheLevel="none">
> 					<% String value =
> ((Agent)pageContext.getAttribute("pSearchAttributeType.currentDO")).getPrope
> rty("Name").toString(); %>
> 					<fci:element name="Value"
> format="option" compare="<%= value %>"/>
> 				</fci:collection>
> 			</select>
> 			<fci:get resource="Suffix.Content"/>
> 		</td>
> 	</tr>
> 	</fci:collection>
> </fci:collection>
> <fci:nonempty collection="globalAttributeSearchDetail">
> <tr>
> 	<td align="left">
> 		<br><fci:get resource="Button.AttributeSearch"/>
> 	</td>
> </tr>
> </fci:nonempty>
> </table>
> </form>
> 
> 
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>