This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
When I am using trying to use a bean in my jsp files I get an error unless I put in the entire class path (in the useBean tag). I have my class in WEB-INF/classes/some/thing/database/ConnectorBean.class <jsp irective.page import="some.thing.database.*" info="Bean Tester Page" contentType="text/html;charset=ISO-8859-1"/> <HTML> <BODY> <!-- Test Dbconnector Bean --> <jsp:useBean id="dbconnector" class="some.thing.database.ConnectorBean" scope="application" /> Like I said it works fine unless I take out the full class path (which should not be required). I made a .jar file, which resides in the WEB-INF/lib/ folder. Does this need to be in the $CLASSPATH variable? Any help would be greatly appreciated. [ November 18, 2003: Message edited by: Kerry Wilson ]
The import statement is immaterial. Although the means of instantiation is left up to the container, most servlet containers will use Class.forName() (or something that eventually calls forName() such as java.beans.Beans.instantiate()) which require a full class name to operate. Resin, interestingly enough, is the only container I tested that does a direct "new" operation, and hence is sensitive to the import. Bottom line is, specify the full class name. bear