You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by James More <Ja...@wcom.com> on 2000/07/20 20:34:11 UTC

finding bean when .jsp in subdir

Hey all,

My problem is that I have beans in the WEB-INF/classes directory, and jsp's on the application root.  The beans work properly when the *.jsp file is in the application root directory.  However, when the *.jsp files are in a subdirectory(ie. jsp), then the beans are not being found.  It assumes the beans are in the package jsp or whatever the name of the subdirectory is.  How do I get around this?

Thanks for any help,
James

Re: finding bean when .jsp in subdir

Posted by Danno Ferrin <sh...@earthlink.net>.
Using the default package (I.E. when classes appear in WEB-INF/classes)
is greatly discouraged.  Try putting the beans in a separate package
such as "package foo" and then use the import page directive to get the
bean classes imported.  You can still leave them in the default package,
but you will need to import each bean by name.  (IE <%@ page
import="bean1,bean2,bean3"%>


> James More wrote:
> 
> Hey all,
> 
> My problem is that I have beans in the WEB-INF/classes directory, and
> jsp's on the application root.  The beans work properly when the *.jsp
> file is in the application root directory.  However, when the *.jsp
> files are in a subdirectory(ie. jsp), then the beans are not being
> found.  It assumes the beans are in the package jsp or whatever the
> name of the subdirectory is.  How do I get around this?
> 
> Thanks for any help,
> James