Tomcat 3.3 is pretty friendly with this. Tomcat 4.x is less forgiving. The problem is that the JSP container may compile the class into whatever package it wants (according to the JSP-Spec). In the case of Tomcat 4.x, this means that your JSP page is compiled into the "org.apache.jsp" package. Without an explicit "import", it won't be able to resolve classes in the default package. As I understand it, you shouldn't be using classes in the default package anyway, since the 1.4.x JVM won't resolve them.
"Thorsten Huber" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I've tried to port an old training-webapps from tomcat 3.3 to > 4.1.12. This webapp contains a simple JSP (counter1.jsp) which > accesses a simple Bean which contains the counter functionality. The > Bean was implemented as a packageless class lying directly in > WEB-FINF/classes. This worked under tomcat 3.3 but on 4.1.12 I get the > following message: > > --- > org.apache.jasper.JasperException: Unable to compile class for JSP > > An error occurred at line: 0 in the jsp file: /counter1.jsp > > Generated servlet error: > [javac] Compiling 1 source file > > .../Standalone/localhost/WebEng2/counter1_jsp.java:41: cannot resolve symbol > symbol : class Counter > location: class org.apache.jsp.counter1_jsp > Counter counter = null; > ... > --- > > The only solution to get this example working under tomcat 4.1.12 was > to move the class into a package and to call it from within this > package. It's a solution that works, but out of curiosity: Can someone > explain me why I have to use packages in 4.1.12? > > > -- > Gruss / Best regards | LF.net GmbH | fon +49 711 90074-414 > Thorsten Huber | Ruppmannstrasse 27 | fax +49 711 90074-33 > [EMAIL PROTECTED] | D-70565 Stuttgart | http://www.lf.net -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
