• Post Reply Bookmark Topic Watch Topic
  • New Topic

java path problem by suwandy  RSS feed

 
suwandy wong
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Expert,
I have problem regarding my java program. I am using JSP, Javabean and JNI.
Recently I need to compile my Javabean and it gives me a weird problem.
I saved most of my java classes in another folder called X360_Classes.
To do that I have to include this line: package X360_Classes;
As for some java files I do not want the classes to go into that folder so I EXCLUDE the above line.
But when I run my JSP it gives me an error saying that the particular class is not found in X360_Classes folder. Though in JSP I clearly stated that
<jsp:useBean id="logchk" class="Login" scope="session"/>
Help me solve this problem ya..i have been cracking my head for days..
My only suspicion is that �C:\tomcat\webapps\ROOT\WEB-INF\classes�
The ROOT folder is the one that actually causing the problem I guess so .
Thank you in advance. Any suggestion will be highly appreciated
Regards
Suwandy
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Beans have to be in a package.
 
danny liu
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can do it either way:
1. add a page directive <%@page import="X360_Classes.*">
or
2. redefine that javabean
<jsp:useBean id="logchk" class="X360_Classes.Login" scope="session"/>
I hope that would help.
Dan
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, Danny, whether or not you have the import, you have to have the full package.class in the useBean because the useBean mechanism needs the complete package and class to instantiate the bean.
Bill
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!