• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using Java Classes in JSP

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
bacon. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic