Try finding out from the compiled jsp's .java code. It could be problem with the package definition rather than classpath.

darine darine
Ranch Hand

Joined: Mar 08, 2001
Posts: 43

posted Mar 09, 2001 05:57:00

0

Thanks for your reply. How and where do we can check out the jsp's java code? however i've checked almost everyword and i've changed even the bean and the jsp file too,i still getting the same message that says can't load the class stringBean. thanks again.

darine darine
Ranch Hand

Joined: Mar 08, 2001
Posts: 43

posted Mar 09, 2001 10:41:00

0

Thanks for your reply. How and where do we can check out the jsp's java code? however i've checked almost everyword and i've changed even the bean and the jsp file too,i still getting the same message that says can't load the class stringBean. thanks again.

Thnaks for your time,it works the way you said,but it works even without the page directive. My question is if i do not put " package beans;" in my stringBean.java file,can i use that directive as above"<%@ page import="beans.*" %> and the i use the action <jsp:useBean id="stringBean" class="stringBean" /> can i do that? thanks for your time again.

paul sun
Greenhorn

Joined: Dec 22, 2000
Posts: 28

posted Mar 09, 2001 15:49:00

0

Either "<%@ page import="beans.*" %> <jsp:useBean id="stringBean" class="stringBean" /> or <jsp:useBean id="stringBean" class="beans.stringBean" /> is ok. But "package beans;" must appear in the "stringBean.java" file. If not, the compiled jsp (or servlet) can not find the "stringBean.class" via the class path search. Compile "stringBean.java" without "package beans;" in the java file, and put the class file in the /web-inf/classes, and then use <jsp:useBean id="stringBean" class="stringBean" /> without directive. See what you get.

Originally posted by darine darine:Thnaks for your time,it works the way you said,but it works even without the page directive. My question is if i do not put " package beans;" in my stringBean.java file,can i use that directive as above"<%@ page import="beans.*" %> and the i use the action <jsp:useBean id="stringBean" class="stringBean" /> can i do that? thanks for your time again.