You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Krishna Mohan Rao D." <d_...@yahoo.co.in> on 2004/02/21 05:11:34 UTC
[users@httpd] HOWTO set classpath -Tomcat
Hi all,
I am using the following jsp page to test my beans. The error I am getting indiactes that tomcat5 is not getting the classpath to my beans. I put the
jar file containing my beans in WEB-INF\lib directory in my appdir.
<html>
<head>
<%@page session="true"%>
<%@page import="jspbeans.beans.* " %>
<jsp:useBean id="tfBean" class="TextField" scope="session"/>
<jsp:setProperty name="field" property="field" value="Name"/>
<jsp:setProperty name="width" property="width" value="20"/>
<jsp:setProperty name="defaultValue" property="defaultValue" value="Anil"/>
</jsp:useBean>
</head>
<body>
<br> <%= tfBean.getHTML() %>
</body>
</html>
The error listing is as follows:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 6 in the jsp file: /jsp/test1.jsp
Generated servlet error:
[javac] Compiling 1 source file
E:\tomcat5\work\Catalina\localhost\project1org\apache\jsp\jsp\test1_jsp.java:6:
package beandir.beans does not exist
import beandir.beans.*;
^
E:\tomcat5\work\Catalina\localhost\project1org\apache\jsp\jsp\test1_jsp.java:46:
cannot resolve symbol
symbol : class TextField
location: class org.apache.jsp.jsp.test1_jsp
TextField tfBean = null;
^
An error occurred at line: 6 in the jsp file: /jsp/test1.jsp
Generated servlet error:
E:\tomcat5\work\Catalina\localhost\project1org\apache\jsp\jsp\test1_jsp.java:48:
cannot resolve symbol
symbol : class TextField
location: class org.apache.jsp.jsp.test1_jsp
tfBean = (TextField) pageContext.getAttribute("tfBean",
^
PageContext.SESSION_SCOPE);
An error occurred at line: 6 in the jsp file: /jsp/test1.jsp
Generated servlet error:
E:\tomcat5\work\Catalina\localhost\project1org\apache\jsp\jsp\test1_jsp.java:51:
cannot resolve symbol
symbol : class TextField
location: class org.apache.jsp.jsp.test1_jsp
tfBean = (TextField) java.beans.Beans.instantiate(
^
this.getClass().getClassLoader(), "TextField");
4 errors
Please help me understand the problem.
Have a nice day.
Regards,
Krishna.
Yahoo! India Insurance Special: Be informed on the best policies, services, tools and more.