Hi all,

I have the following problems with jsp refresh :

I have this bean hierarchy :

DBConfig
|
| uses
|
DBBean <-- DBStaticListBean <-- LanguagesBean

The query.jsp uses LanguagesBean  with a session scope.
In the constructor of the LanguagesBean, a refresh method is called.  The
method through LanguagesBean's ancestor methods connects to a database,
retrieves a resultset, loops in the resultset and stores the values of a
column in an enumeration (private enumeration list).

In the query.jsp, I call getList() that returns the enumeration.

This just works well if the page is accessed for the first time in the
session browser.  If the page is called a second time in the same session, I
get an empty enumeration.
I thought since the bean has a session scope, I could get access to the bean
that had been instantiated in the first hit to the page and thus, the
enumeration resulting from the query run at the construction of the bean.

I think I miss some important mechanism in here.
Can someone explain me what's the point ?

Thanks.

Bertrand


query.jsp
************
blabla
<%@ page language="java" import="java.sql.*"  %>

<jsp:useBean id="languages" scope="session" class="db.LanguagesBean" />
<%! java.util.Enumeration eLanguages;
%>

<%
        eLanguages = languages.getList();
%>
<font color="white" face="Verdana" size=3><strong><em>Query the
repository...</em></strong></font>
<hr color="white">


<TABLE>
<TR>    <TD>
        <font color="black" size=2 face=Verdana><em><strong>
        Implementation Language
        </strong></em></font>
        </TD>
        <TD>
        <SELECT name="language" id=language>

                <% for (java.util.Enumeration e =
eLanguages;e.hasMoreElements();) { %>

                <OPTION VALUE=""><%=e.nextElement()%></OPTION>

                <% } %>

        </SELECT>
        </TD>
</TR>
</TABLE>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to