I created a sample
jsp to use a bean.It is as follows
<%@ page language="java" session="false" %>
<HTML>
<HEAD>
</HEAD>
<BODY>
This is an example of use of JavaBeans.
<jsp:useBean id="per" scope="page"class="Person"/>
</BODY>
</HTML>
I was getting following error when I access using
http://localhost:8080/TestApp/jsp/useBean.jsp ============================== ERROR ============
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 6 in the jsp file: /jsp/useBean.jsp
=================================================
In fact I have placed the class file for Person.java under TOMCAT_HOME/TestApp/WEB_INF/classes, as it does not have package.
The above JSP complies fine if I make Person class part of a package(in my example it is "sungard") and store the class in TOMCAT_HOME/TestApp/WEB_INF/classes/sungard, and change jsp:useBean tag as follows
<jsp:useBean id="per" scope="page"class="sungard.Person"/>
Why is this?.Do I need to configure something else?.I presumed that JSP complier(Jasper) will resolve the class file location using packagaename starting at WEB-INF/classes
Thanks,
Arvind