Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts Users »

Re: request.setAttribute

Honza Spurný

2003-11-28

Replies:

Paul McCulloch wrote:
> It still isn't correct. You staore it as "myObejct" and try and
> retrieve it
> as "myObject"

OK OK, that is only overwrite, sorry... but this is not copied from code,
this is written to make easy view of the problem... In code I have correct
values, realy.

so:
MyObject o = new MyObject();
o.setObjectName("name");
request.setAttribute("myObject", o);

MyObject o2 = (MyObject)request.getAttribute("myObject");

if (o2 == null) System.out.println("NULL");
else System.out.println(o.getObjectName());



>
> Paul
>
>> -----Original Message-----
>> From: Honza Spurn? [mailto:spurny@(protected)]
>> Sent: 28 November 2003 11:51
>> To: Struts Users Mailing List; Honza Spurn?
>> Subject: Re: request.setAttribute
>>
>>
>> Corrected version:
>>
>> MyObject o = new MyObject();
>> o.setObjectName("name");
>> request.setAttribute("myObejct", o);
>>
>> MyObject o2 = (MyObject)request.getAttribute("myObject");
>>
>> if (o2 == null) System.out.println("NULL");
>> else System.out.println(o.getObjectName());
>>
>>
>> The problem still occures. I'm not able to download from request such
>> MyObject as I have stored in. Can it be caused by the huge
>> size of object?
>>
>> Sporak
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@(protected)
>> For additional commands, e-mail: struts-user-help@(protected)
>>
>
>
> **************************************
> Axios Email Confidentiality Footer
> Privileged/Confidential Information may be contained in this message.
> If you are not the addressee indicated in this message (or
> responsible for delivery of the message to such person), you may not
> copy or deliver this message to anyone. In such case, you should
> destroy this message, and notify us immediately. If you or your
> employer does not consent to Internet email messages of this kind,
> please advise us immediately. Opinions, conclusions and other
> information expressed in this message are not given or endorsed by my
> Company or employer unless otherwise indicated by an authorised
> representative independent of this message.
> WARNING:
> While Axios Systems Ltd takes steps to prevent computer viruses from
> being transmitted via electronic mail attachments we cannot guarantee
> that attachments do not contain computer virus code. You are
> therefore strongly advised to undertake anti virus checks prior to
> accessing the attachment to this electronic mail. Axios Systems Ltd
> grants no warranties regarding performance use or quality of any
> attachment and undertakes no liability for loss or damage howsoever
> caused.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@(protected)
> For additional commands, e-mail: struts-user-help@(protected)


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@(protected)
For additional commands, e-mail: struts-user-help@(protected)



©2008 junlu.com - Jax Systems, LLC, U.S.A.