useBean class without being in package
1 posts in topic
Flat View  Flat View

Posted By:   Akuma_Devil
Posted On:   Thursday, October 27, 2005 10:43 PM

Is there a way of having classes run under Tomcat without putting them in a package? I recently moved my code from resin where I would call a class by:


But this refused to work with Tomcat. Instead I had to put my class under a subfolder /WEB-INF/classes/sub/ and give it the package sub. I can now call the code by:


This way of doing it works under Resin also, but I don't want to have subfolders in my /WEB-INF/classes/ directory. Does anyone know how to get the useBean tag to work without the class being in a package?

Re: useBean class without being in package

Posted By:   Christopher_Koenigsberg  
Posted On:   Sunday, November 6, 2005 04:50 PM

Your classes are ALWAYS in a package, whether you give the package names yourself, or let the servlet container name them for you as its "default package".

You are seeing that different servlet containers are free to use different package names, for their "default package", if you don't supply an explicit package name yourself.

The obvious solution is to supply an explicit package name yourself, like you're supposd to, instead of trying to guess the whims of the particular servlet container you are running in.
About | Sitemap | Contact