tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eduardo Pelegri--Llopart <>
Subject Re: VOTE: JDK1.2 compiler
Date Tue, 13 Jun 2000 19:53:06 GMT
I am all for moving to 1.2, but be careful when creating code that
compiles on 1.2 and runs on 1.1.  I have a fair amount of experience
with these issues from a previous package.  The first approach one can
come up with is to have the 1.2 objects in code that will not be
executed when under 1.1.  This may or not work depending on the JVM: the
JVM specification actually leaves quite a bit of leeway, intentionally,
on when binding is resolved, so a valid JVM may complain if the objects
are not there, even if the code is not executed.  Most JVMs I've
encountered are fairly "lazy", but even those will need to load classes
to validate the code, so the behavior may change depending on the
security manager you are running under.

I *think* that it is OK to use reflection to call into an object that is
in a totally different class, which is a Java 2 class, although I'd have
to double check the latest JVM spec to be sure (and check the notes of
my exchanges with Gilad).  In practice, I believe you can make the
assumption that this will work but still, you may want to test this part
carefully and on different JVMs.

Hope this helps,

	- eduard/o wrote:
> >
> > what are the 1.2 features being used that so many other JSP
> > implementations do not need?  Im not as concerned over using 1.2 compilers
> > as I am over what kind of overly complex design is demanding the use of
> > 1.2-only reflection, "complex code", etc.
> The complex code and reflection is needed to use 1.2 features while
> compiling with 1.1.
> For example, JNDI and other extensions do use 1.2 Thread-
> contextClassLoader. You can't use them in tomcat unless tomcat set this,
> but you can't compile Thread.setContextClassLoader() in JDK1.1
> In tomcat 3.1 we used reflection - the code will compile in 1.1, and will
> be executed only if the method is found. This is slow and ugly.
> Another feature is the policy-based security. Very few servlet engines
> implemet this ( AFAIK ), but I think it is one of the greatest features we
> provide - it allows you to run untrusted servlets and JSPs, and sandbox
> tomcat.
> I am also planing on an alternate mapper that will use collections - it
> will be used only in 1.2 env., and will duplicate the current
> SimpleMapper, but will be much faster. It's a module you can configure -
> but you need 1.2 compiler.
> Costin
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message