Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Jsp and location of JavaBeans

 
Ranch Hand
Posts: 625
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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.
 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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.
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Your java bean class should go in WEB-INF/classes (or, if it is packaged in a jar file, in WEB-INF/lib).
 
Sheriff
Posts: 67537
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
... and make sure that Netbeans knows to look for it there.
 
Sean Casey
Ranch Hand
Posts: 625
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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
Sheriff
Posts: 67537
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic