tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Isaacs <Larry.Isa...@sas.com>
Subject RE: class loaded wrong
Date Fri, 09 Nov 2001 19:41:42 GMT
In Tomcat 3.x, if the JSP page is in the web application's
base directory, the JSP servlet will be created in the
default package and your "default-package" beans work.
If the JSP is in a subdirectory of the web application's
base directory, the JSP servlet will be created in a
package matching the subdirectory name and your
"default-package" beans *don't* work because javac
wants them to be in the JSP's package not the default
package.

I believe Tomcat 4.x always puts the JSP servlet in a
package and your "default-package" beans never work.

The correct solution is to always put your beans in a
package so the package used for the JSP won't matter.

Cheers,
Larry

> -----Original Message-----
> From: Huaxin [mailto:hxzhang@cs.ualberta.ca]
> Sent: Friday, November 09, 2001 2:27 PM
> To: Tomcat Users List
> Subject: class loaded wrong
> 
> 
> I am moving my 3.2.3 application to 4.0.1, and it
> failed to work
> 
> my jsp file uses a bean which is defined under WEB-INF/classes
> (without package)
> 
> say that class is MyBean.java, the error log shows
> 
> org.apache.jasper.JasperException: Unable to compile class for JSP
> 
> An error occurred at line: 4 in the jsp file: /process.jsp
> 
> Generated servlet error:
> D:\henry\jakarta-tomcat-4.0.1\work\localhost\survey\process$js
> p.java:61:
> Class org.apache.jsp.MyBean not found.
> 
> 
> Must I define all classes inside a package?
> 
> 
> --
> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
> 

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message