this is a windows server running Apache and Tomcat. I added a new class to an existing package and tried to reference it from a jsp page like this:
jsp:useBean id="promotion" class="MY.NEWCLASS" scope="session"
am I missing something? Do I need to do something special to add a class to a package? Thanks in advance.
the jsp page loads fine, but when I try clicking on the button that uses this class I get
uncaught exception: java.lang.ClassNotFoundException:MY.NEWCLASS
You need to ensure that the class file is present in
/WEB-INF/classes/MY/NEWCLASS.classof the deployed webapplication. Or when it’s in a folder/MY/NEWCLASS.classinside a JAR file with the namefilename.jar, then you need to ensure that it is present in/WEB-INF/lib/filename.jarof the deployed webapplication.Please note that the fully qualified name is case sensitive. So the name must be an exact match. Maybe you was careless with the code example in your question, but using capitals this way is not a normal naming convention. Chances exist that it is actually called
my.NewClassfor example. You should then declare as such in yourjsp:useBean.