This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi all, I have written one bean & placed the class file of the same bean in the WEB-INF/classes folder. The bean is not in any package, but it is in default package.i.e there is no package statement in the bean's java file.Now i want to use the same bean in a jsp. Now when i try to instantiate the bean i am getting the error. The jsp engine is not able to find the class. i tried to import the class, but still got another error. Now when i put the bean in a package and try to use it in the jsp, it worked fine.
Question : Is it mandatory to put a bean inside a package ?
If you think you can, you can. If you think you can't, you are right.
Furthermore - the convention for the JVM finding a default package class is to look in the "current" directory. In a server environment you have no control over the "current" directory so you have to use a package. Bill