Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 82902 invoked from network); 28 Sep 2000 09:14:13 -0000 Received: from unknown (HELO vdcrexc1.orange.ch) (212.215.1.70) by locus.apache.org with SMTP; 28 Sep 2000 09:14:13 -0000 Received: by vdcrexc1.orange.ch with Internet Mail Service (5.5.2650.21) id ; Thu, 28 Sep 2000 11:13:45 +0200 Message-ID: <2B26E094BB13D3118FB3006008214FA5F06F50@vdlaexc0.orange.ch> From: Kitching Simon To: "'tomcat-user@jakarta.apache.org'" Subject: RE: Problem with JSP compiler Date: Thu, 28 Sep 2000 11:13:38 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N > -----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