I looked at all of the java files in the jar, it has the package declaration at the
top:
package com.equifax.rcas.tools;
I put the java files into the WEB-INF/classes directory. Then referenced them this
way.
<%
com.equifax.rcas.tools.B2BHtmlUI myObject = new
com.equifax.rcas.tools.B2BHtmlUI();
%>
I replaced SomeClass with a class from one of the java files. Here's the class
header...
public class B2BHtmlUI extends Object implements B2BUI
{
Still getting an error:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 1 in the jsp file: /dev/test.jsp
Generated servlet error:
[javac] Compiling 1 source file
/web1/labwerks/tomcat/work/Standalone/localhost/_/dev/test_jsp.java:46: package
com.equifax.rcas.tools does not exist
com.equifax.rcas.tools.B2BHtmlUI myObject = new
^
An error occurred at line: 1 in the jsp file: /dev/test.jsp
Generated servlet error:
/web1/labwerks/tomcat/work/Standalone/localhost/_/dev/test_jsp.java:47: package
com.equifax.rcas.tools does not exist
com.equifax.rcas.tools.B2BHtmlUI();
^
-----Original Message-----
From: Turner, John [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 1:46 PM
To: 'Tomcat Users List'
Subject: RE: trying to use jar file in jsp page.
Do you have the source code to this library? It may be that the classes are
not in a package. If a package hasn't been defined like this:
package com.equifax.rcas.tools
in every class file in that package, then there is no package.
What happens if you extract the classes and put them in WEB-INF/classes?
I'm pretty sure at that point that you could just call them without having
to do a page import.
Something like
<%
com.equifax.rcas.tools.SomeClass myObject = new
com.equifax.rcas.tools.SomeClass();
myObject = "java code shouldn't be in a JSP";
%>
John
> -----Original Message-----
> From: Brian O. Bozarth [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 09, 2002 1:38 PM
> To: [EMAIL PROTECTED]
> Subject: trying to use jar file in jsp page.
>
>
>
> Still stuck on this. I also re-jar-ed the file so that com
> was the first directory in the jar file. The java files
> are in the tools folder. Any insights?
>
> I put the jar file in the /tomcat/webapps/ROOT/WEB-INF/lib
> folder, which is where I am doing my app.
>
> I am trying to use this in my jsp file (but I get an error):
>
> <%@ page import="com.equifax.rcas.tools.*"%>
>
> getting an error of:
>
>
> org.apache.jasper.JasperException: Unable to compile class for JSP
>
> An error occurred at line: -1 in the jsp file: null
>
> Generated servlet error:
> [javac] Compiling 1 source file
>
> /web1/labwerks/tomcat/work/Standalone/localhost/_/dev/credit_c
> heck_jsp.java:7: package com.equifax.rcas.tools does not exist
> import com.equifax.rcas.tools.*;
> ^
> 1 error
>
> I am using Apache Tomcat/4.1.12
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>