• 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

Accessing Java Object in JSP

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is a problem i have, might be a very basic issue to many here...
1. I have a java object at <server_root>/<application_directory>/javaclass directory.
2. The Class belongs to package javaclass
3. My jsp resides in <application_directory> and it does a
<%@ import="javaclass.ConnPool" %>
4. but when I try to instantiate the ConnPool it throws me an error
Class jsp_servlet._gs._eshop.ConnPool not found.
probably occurred due to an error in /GS/eShop/connection.jsp line 6:
ConnPool connP = new ConnPool();

Can anyone shed light on why the jsp page is not able to access the java object ?

TIA
Narsi
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have a java object at <server_root>/<application_directory>/javaclass directory.


To be available to your web application, your package hierarchy should be rooted at WEB-INF/classes.
Therefore, your class should reside in:

hth,
bear
 
Narasimhan Balasubramanian
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does this apply even if I am using weblogic ?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It does if weblogic follows the standards for web applications. (If it doesn't, I ditch it faster than a flaming porcupine!)
hth,
bear
 
reply
    Bookmark Topic Watch Topic
  • New Topic