In this code, Demo is Java program, Vendor is my jar file and initialise() is a method in Demo program, which returns null value.
When I run this program in Tomcat5.0, I am getting the following errors: Type:Exception report The web server has encountered an internal error in fulfilling this request. org.apache.jasper.JasperException:/evendor/ebs.jsp(2,0)The value for useBean class attribute Demo is Invalid. org.apache.jasper.compiler.DefaultErrorHandler.jspError("DefaultError.java") org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java) org.apache.jasper.compiler.Generator$generatevisitor.visit(Generatot.java) and many more exceptions.
Originally posted by Sridevi Kumarasamy: I have jarred the necessary class files and kept it in tomcat5.0\common\classes directory.
Jar files go in the lib, not the classes directory.
CATALINA_HOME/common is a place holder for classes and libraries used by both the applications and Tomcat itself. If your classes aren't being used by the Tomcat engine but need to be accessible by multiple applications, they should go under CATALINA_HOME/shared/classes or CATALINA_HOME/shared/lib (if they are jar files).
I prefer to put them under WEB-INF/classes or WEB-INF/lib. This keeps all of my code within the confines of my webapp.
Sridevi, there are some mistakes in your code also which I would like to point out :
your code : <@page language=java import=vendor>
the page directive should be like this :
1) you missed '%' in directive 2) values for attributes like language, import should be put in quotes. This applies to all places where attribute-value pairs are present. 3) You said vendor is jar file. Jar file name are never used in import statements. Only classes and packages are used in import statements. It should be ensured that jar files is present in application classpath.
<%=bill.initialise();%> semicolon is not necessary here
You should see to your application deployment first as Ben has suggested.