struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Honza Spurný <spu...@master.cz>
Subject Re: request.setAttribute
Date Fri, 28 Nov 2003 11:46:49 GMT
Andrew Hill wrote:
> <snip>
> request.setAttribute("myObejct", o);
> ...
> MyObject o2 = (MyObject)request.getAttribute("o");
> </snip>
>
> You arent looking up the same attribute that you stored it under.
> Thats why you get null!
> Try:
> MyObject o2 = (MyObject)request.getAttribute("myObejct");
>
> (btw: object is spelt "object" not "obejct")
>

SORRY, these was my mistake, of cause I'm searching for "myObject" in the
request variable... sorry, sorry, sorry...

>
> The size of the object shouldnt be an issue in the request attributes
> as the request object becomes eligible for gc after the container has
> written the response. (otoh If you needed to store it in the session
> then you might have cause for concern).
>
> -----Original Message-----
> From: Honza Spurný [mailto:spurny@master.cz]
> Sent: Friday, 28 November 2003 19:40
> To: struts-user@jakarta.apache.org
> Subject: request.setAttribute
>
>
> Hi there,
>
> I have small problem with adding some objects to the request. I need
> to store quite huge object into request variable
>
> MyObject o = new MyObject();
> o.setObjectName("name");
> request.setAttribute("myObejct", o);
>
> These are correct steps how to make it, aren't they? But the object
> MyObject is really huge. Is it possible, tak the huge objects are not
> store into request variable? Because when I store there object that
> surely exists, and then I call
>
> MyObject o2 = (MyObject)request.getAttribute("o");
> if (o2 == null) System.out.println("NULL");
> else System.out.println(o.getObjectName());
>
> I always get NULL on output.
>
> Can be there problem with the size of such object?
>
> Thanks
> Sporak
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


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


Mime
View raw message