This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding Classes in Netbeans

 
Sean Casey
Ranch Hand
Posts: 625
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I'm having trouble with class not found exceptions in netbeans. I can set up a project with servlets and jsp's fine, but when I create another class and then create a new object of that class inside a jsp, I get a class not found exception. Where do I add these plain java classes so that the jsp will find them on compilation?
 
Alexis Sumalpong
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use "Likha Devcentre" to compile.
Put your JavaBeans in the proper package in /classes
Put you JSP file somewhere in /src
Then compile your JSP

Originally posted by Sean Casey:
hi,
I'm having trouble with class not found exceptions in netbeans. I can set up a project with servlets and jsp's fine, but when I create another class and then create a new object of that class inside a jsp, I get a class not found exception. Where do I add these plain java classes so that the jsp will find them on compilation?
 
Sean Casey
Ranch Hand
Posts: 625
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm still getting an error. Maybe I should mention this in detail:
I created a web module and under classes I have a class Tester that just contains a no-arg constructor. Outside of that directory I have a jsp called test.jsp. In the middle of the jsp I have a scriptlet like the following:

I compile the Tester class with no problems, but when I try to compile the jsp I get the following error:

Anyone know what I'm doing wrong?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic