You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Guido García Bernardo <gg...@itdeusto.com> on 2004/01/27 21:52:18 UTC

[OT] Re: populating session object

Maybe you can use the application scope:

foo.Employees employees = (foo.Counter)getServletContext().getAttribute("employees");
if (employees == null) {
  employees = new foo.Employees();
  getServletContext().setAttribute("employees", employees);  
}

and then

<jsp:useBean  class="foo.Employees" *scope="application"* />

Be careful, because I am almost sure that objects placed in application 
scope will be used by more than one thread so you must design them 
accordingly.

Regards!
Guido García

PD. BTW, is there any _free_ memory profiler or something similar to 
JProbe or OptimizeIt?

shankarr wrote:

> Hello!
>
> Currently, in my design, I am using a DO class and a DOService class 
> for my business logic.
> In my case, I make a db query to get a list of all employees.
> But, at the end, the result has to be set in a session or in a request 
> object.
> Given a case where we have lots of users making a get, I believe the 
> memory requirement will go up and will
> need a very high RAM.
>
> Is there any other way of handling this or I am missing something?
>
> Richie
>
> "To achieve all that is possible, one must attempt the impossible"


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org