tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: JSP : Can not retrieve Object stored from servlet into session
Date Tue, 17 Oct 2000 16:11:53 GMT
Werner Ramaekers wrote:

> But the class is not in a package, so ...
> anyone else have an idea ?
>

If you want to use a Java class in a <jsp:useBean> action, it *should* be in
a package.

The reason for this has to do with the way that Java compilers look at
classnames with no packages.  They assume that the class is in the same
package as the calling class itself (in this case, the servlet class that is
generated from your JSP page).  However, different servlet containers
generate these servlets into different packages.  In order to be portable,
you must put your own beans in packages to make this unambiguous.

The values you specify for the "type" or "class" attributes of the
<jsp:useBean> action must be fully qualified class names (i.e. they must
include the package prefixes).

Craig McClanahan

====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat



Mime
View raw message