well basically i want different instances of application scope beans.

if i use the <usebean tag> if will be using the same instance. with the code I have I am able to create different instances of application scope however, i realize now that the getproperty and setproperty have problems using the way i implemented






From: Barney Hamish <[EMAIL PROTECTED]>
Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]>
To: 'Tomcat Users List' <[EMAIL PROTECTED]>
Subject: RE: instance names problem will pay $2 for solution
Date: Wed, 2 Apr 2003 13:24:27 +0200


Is there are reason you can't just use: session.setAttribute(tempName); and then later session.getAttribute(tempName);???

Hamish

> -----Original Message-----
> From: Michael Ni [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 02, 2003 1:11 PM
> To: [EMAIL PROTECTED]
> Subject: Re: instance names problem will pay $2 for solution
>
>
> <jsp:useBean id="temp" scope="request"
> class="beangame.GameInstance" />
> <jsp:setProperty name="temp" property="*" />
>
>
> <%
>    String tempname = temp.getInstance_name();
>
>    beangame.Earthquake counter1 =
> (beangame.Earthquake)getServletContext().getAttribute(tempname);
>    if (counter1 == null) {
>            out.println("is null <p>");
>            counter1 = new beangame.Earthquake();
>            getServletContext().setAttribute(tempname, counter1);
>    }
>
> %>
>
> This is a snippet from my code basically im trying to create
> an instance of
> an application scope bean but naming it myself with the
> stored value of
> tempname which i get from another bean temp using getInstanceName()
>
> how do I apply reflection so I can use the instance which
> name is not in the
> code at all.
>
> mike
>
> _________________________________________________________________
> The new MSN 8: smart spam protection and 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to