tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kitching Simon <Simon.Kitch...@orange.ch>
Subject RE: Problem with JSP compiler
Date Thu, 28 Sep 2000 09:13:38 GMT


> -----Original Message-----
> From:	Peter Choe [SMTP:choepete@mindspring.com]
> Sent:	Wednesday, September 27, 2000 6:41 PM
> To:	tomcat-user@jakarta.apache.org
> Subject:	Re: Problem with JSP compiler
> 
> vector is in java.util.  so you need to
> 
> import java.util.*;
> 
	[Kitching Simon]  

	Just to expand a bit further: I think you've been bitten by the same
problem
	we've been suffering from. Some jsp compilers (I mean the bit that
converts a
	.jsp to a .java file) happen to insert some import statements that
your jsp code
	can see. In particular, I am thinking of jDeveloper3.1 (ie
jBuilder). However, as far
	as I can see, this is *not* standards-compliant behaviour and they
should not be doing it.
	Tomcat's jsp-compiler does not add these import statements for you;
if you want to
	use Enumeration, etc in your jsp, you need a import="java.util.*" in
the <%@ page>
	tag. As a result, code that works in jDeveloper doesn't work in
tomcat until the extra
	import is added. It's a real pain, but as far as I can see, the
fault is not tomcat's...

	on the other hand, because tomcat is importing Vector, and this
import is visible to the jsp
	code, then that's not really nice as code that runs in tomcat and
depends on Vector
	being auto-imported would not run in any other environment that
doesn't import Vector.

	Sigh....

	Hope this helps,

	Simon
> GEORGE David wrote:
> 
> > I'm having problems getting the Tomcat 3.1 JSP compiler to compile my
> JSPs!
> >
> > The JSP references some external classes, an Enumeration, a Resource
> Bundle
> > and a Langue object.  I'm using jdk1.2.2 btw.
> >
> > Well first problem the compiler couldn't find the external classes.  So
> I
> > copied this under the jakarta-tomcat/classes directory for the time
> being.
> > Then it couldn't find the standard classes.  Well I noticed that it was
> > starting with jdk1.2.2/lib/tools.jar and these classes are actually in
> > jre/lib/rt.jar, so I added this to the classpath in tomcat.bat.  But
> still
> > same problem.
> >
> > So I looked at the generated .java file and noticed  that although it
> had
> > added a load of imports, such as java.lang.Vector, it hadn't added
> imports
> > for things like java.util.Enumeration.  Anyone know why this is?
> >
> > David

Mime
View raw message