Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Importing Custom Classes into a JSP page

807598Jun 1 2006 — edited Mar 13 2007
Hello,

I have created custom package com.srjgroup.report. It sits in C:\workspace\src\com\srjgroup\report directory. I have java files as well as compiled classes there. No jar files there.

did amend classpath to point to this directory.

In my JSP page I have the import statement as following
import="java.sql.*, java.util.*, java.text.SimpleDateFormat, com.srjgroup.report.*"
It imports all the packages without any errors. However, when I try to use one of the classes in the package, I get error

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 3 in the jsp file: /SQLServer.jsp
Generated servlet error:
SRJReports cannot be resolved to a type


SRJReports is one of the classes that I am trying to use in that package. When I comment out all references to the class, everything is fine.

So, to fix this I moved the entire package to
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\lib direcory, preserving the hierarhy. So, now my custom package is located here:

C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\lib\com\srjgroup\report again there are no jar files, only java and classes here. Still, no go.

What am I doing wrong ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 10 2007
Added on Jun 1 2006
5 comments
1,400 views