Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: two instances of the same bean


Message #1 by "Massimo LoVoi" <mlv@s...> on Fri, 15 Jun 2001 15:01:17
depending on the purpose of the bean, and how you use it...there should be 
no problems with what you are doing.

for example...lets think about a simple invoice, you could generally have a 
"bill to", "ship to", "ship from" beans..each representing the address 
information for the actors in the system.  each of these beans could be the 
same exact type of bean, just different properties, and when you create the 
invoice you would need to access each actor (say by primary key), and use 
them in your JSP.

hope this is clear.



At 03:01 PM 6/15/2001 +0000, you wrote:
>Hi,
>Is it a good practice instantiate the same bean twice in the same jsp?
>
><%@ page import="com.beans.mybean"%>
><%
>mybean bean = new mybean();
>mybean secondbean = new mybean();
>%>
>
>Thanks,
>Massimo
>
>
>---


Robert Chartier
Author, AspFree.com
xxx-xxx-xxxx
rob@a...
http://www.aspfree.com/devlinks
http://www.aspfree.com/authors/robert
http://www.aspalliance.com/nothingmn


  Return to Index