tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Danno Ferrin" <DFER...@novell.com>
Subject Re: AW: error parsing custom tags without body
Date Sun, 28 Nov 1999 20:22:28 GMT

>>> John.Brush@swisslife.ch 11/25/99 06:31AM >>>
> Well, according to the specification (V1.1PR2), section 5.1.2. under "Simple
> Actions" it is legitimate to have "no text between the start and end tag",
> and there is no context in which this is not true. It is possible, however,
> to specify in the tag library descriptor one of three values for
> "bodycontent", namely "tagdependent", "JSP" or "empty", but in every case an
> empty body is always legal.
> 
> Since an empty body is always in accordance with the standard, there are
> really only two possibilities:
> 
> 1. the tomcat project is using a different version of the standard than I
> am, or
> 2. it's a bug

Short answer, its a know bug solved in the latest code in the CVS.  If the tarball fails use
CVS to get at the code.

long answer, it's a known bug in 1.1.x and 1.2.x that will not be fixed by Sun, but it can
be avoided very easily by Jasper.  It is fixed in the current CVS code but formerly I have
found that the tarballs being generated are being generated with old code, not the current
tip of the CVS.  The old tarballs thing is an issue I have posted to this list before, but
it had no follow up discussion which leads me to believe it wasn't addressed.  Since I have
switched to getting code from CVS it doesn't bother me anymore and may even be fixed, but
I cannot say either way.

Check the CVS version of the file 
tomcat-jakarta/src/share/org/apache/jaspaer/compiler/TagEndGenerator.java
... (it is in the javadoc header for tarball versions)  if it is any earlier than 1.6 then
you will have the bug.



What happend is that the code that was generated looked like...

...{code to handle start tag}...
try {
    ...{whatever code was in the tag}...
} catch (Throwable t) {
    ... {print and dispose of the exception} ...
} finally {
   ... { do close tag and release } ...
}

For an empty tag it would create a block

...{stuff}...
try {
  // various comments
} catch (Throwable t) {
  ... {stuff} ...
} finally {
  ... [stuff} ...
}

This would create byte code for the try block that could not throw any exception at all, including
runtime exceptions, either rendering the catch block dead code and becoming flagged as invalid
or creating an exception entry so small that it was presumed to be zero.  JDK 1.3beta does
not have this problem according to the bug people at sun, so either the vm in 1.3 allows such
a small exception table entry or the compiler packaged with 1.3 removes the "dead" catch block
like it would an "if (false)" block (no source, wouldn't know).

What is now gerneated is simply a try block and a finally block without the catch, which was
changed to allow the exceptions that the tag interfaces can throw open to the whole service
metod for handeling.

--Danno


Mime
View raw message