Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling javabeans from a servlet

 
Bron Czimes
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there,

i have a servlet and I need to create a new instance of a javabean i have also created, but my servlet is about four folders away from the javabean.
my servlet is within WEB-INF/classes/com/mycompany and my javabeans are just within my context root. it won't allow me to create my java beans within the servlet, giving me an error of "it cannot resolve the symbol" blah blah.
i know that you are able to import the web-inf folders into jsp's n so on, so that you are able to make use of servlets etc, but can it work the other way around, so that i can make use of my javabeans?
I'm assuming that I have my servlets in the right spot.
All my files are within the context root, except for web.xml which is in WEB-INF, and my servlets which are in WEB-INF/classes/com/mycompany. Is this correct?
 
Sheldon Fernandes
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bron,

All class files for a web application need to be placed either
- in the WEB-INF/classes folder (with appropriate package structure) OR
- packaged in a jar and placed in the WEB-INF/lib folder

Your bean classes too would need to placed in one of the above locations.

Sheldon
 
Bron Czimes
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic