Hi fellas,
     I have some data in the database that will not change ( example..a list of
all Departments ). I will be using
this data throughout my application( in a number of screens ). I plan to use a
bean that stores all this data in a Vector.

If in my JSP page(s) i use something like this... am i doing it the correct way?


persistence.jsp
-----------------------

<jsp:useBean  id="department" class="x.y.z.DepartmentBean" scope="application"
/>

<% department.populate() ; %>


abc.jsp
-----------
<%@ page import = "java.util.Enumeration" %>

<HTML>
<HEAD> </HEAD>
<BODY>

     <jsp:include page="persistence.jsp">

               <%

               Enumeration  enum = department.getData() ;
               while(enum.hasMoreElements() )
                  {
                  out.println( enum.nextElement() ) ;
                  }

     %>
     some other presentation logic.....

</BODY>
</HTML>

xyz.jsp
----------
<%@ page import = "java.util.Enumeration" %>

<HTML>
<HEAD></HEAD>
<BODY>

     <jsp:include page="persistence.jsp">

               <%

               Enumeration  enum = department.getData() ;
               while(enum.hasMoreElements() )
                  {
                  out.println( enum.nextElement() ) ;
                  }

     %>

     some other presentation logic....

</BODY>
</HTML>



Cheers,
Amar..

===========================================================================
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