This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSP and the fly likes Accessing Java Object in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Accessing Java Object in JSP" Watch "Accessing Java Object in JSP" New topic
Author

Accessing Java Object in JSP

Narasimhan Balasubramanian
Greenhorn

Joined: Mar 28, 2003
Posts: 5
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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63202
    
  69

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Narasimhan Balasubramanian
Greenhorn

Joined: Mar 28, 2003
Posts: 5
Does this apply even if I am using weblogic ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63202
    
  69

It does if weblogic follows the standards for web applications. (If it doesn't, I ditch it faster than a flaming porcupine!)
hth,
bear
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accessing Java Object in JSP
 
It's not a secret anymore!