my dog learned polymorphism*
The moose likes Websphere and the fly likes Using Java Classes in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Websphere
Bookmark "Using Java Classes in JSP" Watch "Using Java Classes in JSP" New topic
Author

Using Java Classes in JSP

Doug Baker
Greenhorn

Joined: Dec 16, 2002
Posts: 2
Hi:
I am not able to get my JSP to find my Java classes that I would like to import into into it.
I have my JAR files in webApplication/WEB_INF/lib. And they show up in the Build Path. I am importing the classes the JAR files contain like this:
< !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page import = "com.ficoh.customer.CustomerNumber"%>
<%@ page import = "com.ficoh.search.*"%>
<%@ page import = "com.ficoh.system.helpers.FicohProperties"%>
But when I run the JSP in the WebSphere server, I get classes can not be found like this:
Error Message: C:\Program Files\IBM\Application Developer\workspace\webtest\webApplication\myjsp.jsp(31,0) JSPG0059E: Unable to compile class for JSP nullC:\Program Files\IBM\Application Developer\workspace\.metadata\.plugins\com.ibm.etools.server.tools\tmp0\cache\localhost\Default_Server\DefaultEAR\webtest.war\_myjsp_jsp_1.java:17: Class com.ficoh.customer.CustomerNumber not found in import. import com.ficoh.customer.CustomerNumber; ^ nullC:\Program Files\IBM\Application Developer\workspace\.metadata\.plugins\com.ibm.etools.server.tools\tmp0\cache\localhost\Default_Server\DefaultEAR\webtest.war\_myjsp_jsp_1.java:18: Package com.ficoh.search not found in import. import com.ficoh.search.*; ^ nullC:\Program Files\IBM\Application Developer\workspace\.metadata\.plugins\com.ibm.etools.server.tools\tmp0\cache\localhost\Default_Server\DefaultEAR\webtest.war\_myjsp_jsp_1.java:19: Class com.ficoh.system.helpers.FicohProperties not found in import. import com.ficoh.system.helpers.FicohProperties; ^ 3 errors
Error Code: 500
Target Servlet: null
Error Stack:
org.apache.jasper.JasperException: JSPG0059E: Unable to compile class for JSP nullC:\Program Files\IBM\Application Developer\workspace\.metadata\.plugins\com.ibm.etools.server.tools\tmp0\cache\localhost\Default_Server\DefaultEAR\webtest.war\_myjsp_jsp_1.java:17: Class com.ficoh.customer.CustomerNumber not found in import.
import com.ficoh.customer.CustomerNumber;
^
nullC:\Program Files\IBM\Application Developer\workspace\.metadata\.plugins\com.ibm.etools.server.tools\tmp0\cache\localhost\Default_Server\DefaultEAR\webtest.war\_myjsp_jsp_1.java:18: Package com.ficoh.search not found in import.
import com.ficoh.search.*;
^
nullC:\Program Files\IBM\Application Developer\workspace\.metadata\.plugins\com.ibm.etools.server.tools\tmp0\cache\localhost\Default_Server\DefaultEAR\webtest.war\_myjsp_jsp_1.java:19: Class com.ficoh.system.helpers.FicohProperties not found in import.
import com.ficoh.system.helpers.FicohProperties;
^
3 errors

What am I doing wrong? I am really lost here. Any advice will be appreciated.
Thanks!
Doug
Doug Baker
Greenhorn

Joined: Dec 16, 2002
Posts: 2
My import statements are missing from my original post. Here they are:
<%@ page import = "com.ficoh.customer.*"%>
<%@ page import = "com.ficoh.search.*"%>
<%@ page import = "com.ficoh.system.helpers.FicohProperties"%>

Thanks
 
GeeCON Prague 2014
 
subject: Using Java Classes in JSP