Here is what I have:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>
<jsp:useBean id="Pets"
             class="sun.jdbc.rowset.CachedRowSet"
             scope="session">
<%
  // load database driver
  Class.forName("org.gjt.mm.mysql.Driver");
  // initialize our CachedRowSet bean
  Pets.setUsername("mysqluser");         // example userid
  Pets.setPassword("user1");     // example password
  Pets.setUrl("jdbc:mysql://192.168.0.1:3306/myowndb");
  Pets.setCommand("SELECT name, owner,species, birth from pet");
  Pets.execute();
%>
</jsp:useBean> 
//above will put a bean in the session right? now how to retrieve those with
// JSTL tags?
<table>
 <c:forEach var="pets" items="${sessionScope.Pets}">
    <tr>
     <c:out value="${pets}"/>
    </tr>
  </c:forEach>
</table>

I can not get the tabular column contents from the Bean via <c:out
value="${pets}"/>   
1. First thing is, using <jsp:useBean> the way I did, puts as "Pets" bean in
session scope right? And this is in the JSP script domain not JSTL ?

2. How then do I get to that session variable "Pets" via JSTL? is the
${sessionScope.Pets} in the c:forEach tag not correct? If not please show
me the proper way.

3. and once its in the JSTL, how to iterate this correctly? 

4. Is session the wrong scope? Meaning if the database contents has changed,
the
RowSet will not get updated since a "Pets" bean currently exist in session and
will got retrieve new data until the session expires? Any elaboration on this
is appreciated. 

__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/

--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@;jakarta.apache.org>

Reply via email to