aspose file tools*
The moose likes JSP and the fly likes Jsp and location of JavaBeans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply locked New topic
Author

Jsp and location of JavaBeans

Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
Hi,
I have a simple javabean class in a Player. I then have a jsp page that uses a scriptlet to create a new Player object. But every time I try to compile the jsp page (using Netbeans) I get an exception explaining that the Player class cannot be found. So my question is, do I need to adjust the classpath, or is there a special directory the javabean class needs to go in so that the jsp page can find it upon compilation?
Thanks for any help.
Craig Jackson
Ranch Hand

Joined: Mar 19, 2002
Posts: 405
Well, you probrably want to make sure you are importing the class using the page directive or the <jsp:useBean> tag. Also make sure that WAR file is structed correctly and the package(s) are apart of your WAR file. I hope I understand your question.
for example or
.
Craig.
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
Your java bean class should go in WEB-INF/classes (or, if it is packaged in a jar file, in WEB-INF/lib).


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

... and make sure that Netbeans knows to look for it there.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
Thanks for all the suggestions. How do I make sure Netbeans knows where to look for the files? I think this may be my problem. Is there a specific way to do this?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

Since this has clearly become a Netbeans issue, I was going to shuffle this along to the IDE forum, but noticed you had already posted there.
Please continue any discussion here and please don't cross-post what is essentially the same question in multiple fourms.
thanks,
bear
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jsp and location of JavaBeans