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?
Joined: Aug 18, 2004
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.