Hallo Michael,

thanks for your advice, but I'm not sure whether I understood you right. What I want to achieve is the following: In the .jsp file, two beans are initialized: the application scope bean holding a DB connection pool, and a page (or whatever) scope bean, uses request data to initialize itself. Later in the .jsp file, the page scope beans data should be made visible through a <jsp:getProperty ...> action. The reason for this is, that as less as possible scripting should be packed into the .jsp file.

Michael Fuhrman wrote:

Ralf,

JSP can access your Java bean directly.  In the sun demo, it demonstrates
how to do this.

Provided here is a snippet of the Calendar example:

>>> jsp1.0/examples/jsp/cal/cal1.txt <<<
 

<%@ page language="java" import="cal.*" %>
<jsp:useBean id="table" scope="application" class="cal.TableBean" />

<%
        table.processRequest(request);
        if (table.getProcessError() == false) {
%>

<!-- html table goes here -->
 
 

Michael J. Fuhrman
Reliable Business Computers
http://www.creliable.com/ <http://www.creliable.com/>

-----Original Message-----
From: Ralf Riedel [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 14, 1999 3:51 PM
To: [EMAIL PROTECTED]
Subject: how to access application bean data

Hi there,

I'd like to access data I've stored in an application bean from within an
other beans code. The application bean manages a pool of db connections,
from which other beans may want to grab one to get able to access the
database. Now, the only way I know to access the application bean later is
from a servlet through the ServletContext. So my question: Is there a way
the get on the data stored in the application bean without using servlets,
e.g. directly from the code of the bean which needs database access?

many thanks,
ralf
 

-----------------------------------------------------------------
 Ralf Riedel                          [EMAIL PROTECTED]
 Multimedia Software GmbH Dresden          Tel. +49 351 8505 827
 Tele-Applications and Services            Fax. +49 351 8505 888

 We're back to the times where men were men and wrote their own
 device drivers - Linus Thorvalds


-----------------------------------------------------------------
 Ralf Riedel                          [EMAIL PROTECTED]
 Multimedia Software GmbH Dresden          Tel. +49 351 8505 827
 Tele-Applications and Services            Fax. +49 351 8505 888

 We're back to the times where men were men and wrote their own
 device drivers - Linus Thorvalds
  =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to