File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Java class in default package and JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Java class in default package and JSP" Watch "Java class in default package and JSP" New topic

Java class in default package and JSP

Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1183
I'm using Weblogic 5.1 SP 8.
beans.jsp has the following code -
<!-- %@page import="test.LanguageBean" % -->
<jsp:useBean id="languageBean" scope="page" class="test.LanguageBean">
LanguageBean.class is placed under WEB_INF/classes/test and the class is defined to be in the test package.
The above scenario works fine.
When I drop the package statement and move the class to WEB_INF/classes the jsp fails.
The modified jsp is -
<!-- %@page import="LanguageBean" % -->
<jsp:useBean id="languageBean" scope="page" class="LanguageBean">
Any ideas,

William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I believe William Brogden answers your question in his posting at
I agree. Here's the link:
subject: Java class in default package and JSP
It's not a secret anymore!