Re: request.setAttribute

2003-11-28 Thread Shyam Krishnan
Why you are putting it into the request yaar?? U can put it into the session.. Regards, Shyam Honza Spurný [EMAIL PROTECTED] 11/28/03 05:10 PM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To [EMAIL PROTECTED] cc Subject request.setAttribute Hi there, I have small

RE: request.setAttribute

2003-11-28 Thread Andrew Hill
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)

RE: request.setAttribute

2003-11-28 Thread Paul McCulloch
You are storing it in the request with the name myObejct but trying to retrieve it with the name o. Use: MyObject o2 = (MyObject)request.getAttribute(myObejct); Paul -Original Message- From: Honza Spurn [mailto:[EMAIL PROTECTED] Sent: 28 November 2003 11:40 To: [EMAIL PROTECTED]

Re: request.setAttribute

2003-11-28 Thread Honza Spurný
Shyam Krishnan wrote: Why you are putting it into the request yaar?? U can put it into the session.. I don't want it in session, I need this object just for a request... Regards, Shyam Honza Spurný [EMAIL PROTECTED] 11/28/03 05:10 PM Please respond to Struts Users Mailing List

RE: request.setAttribute

2003-11-28 Thread Lopez, Felix
The correct sentence for that is: MyObject o2 = (MyObject)request.getAttribute(myObejct); Not MyObject o2 = (MyObject)request.getAttribute(o); You must get the name of the Attribute and the method returns the instance T-Systems ITC Services España, S.A. Félix López Depto. Sanidad Telf. 932 535

Re: request.setAttribute

2003-11-28 Thread Honza Spurn
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

RE: request.setAttribute

2003-11-28 Thread Claire Wall
Hi Sporak, The name which you have given your object is myObejct so when you try to retrieve this object off of the request, you need to do: MyObject o2 = (MyObject)request.getAttribute(myObejct); and not: MyObject o2 = (MyObject)request.getAttribute(o); Doing it this way (the way you have

Re: request.setAttribute

2003-11-28 Thread Honza Spurn
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

RE: request.setAttribute

2003-11-28 Thread Paul McCulloch
It still isn't correct. You staore it as myObejct and try and retrieve it as myObject Paul -Original Message- From: Honza Spurn [mailto:[EMAIL PROTECTED] Sent: 28 November 2003 11:51 To: Struts Users Mailing List; Honza Spurn Subject: Re: request.setAttribute Corrected version

Re: request.setAttribute

2003-11-28 Thread Honza Spurn
] 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

RE: request.setAttribute

2003-11-28 Thread Paul McCulloch
] Sent: 28 November 2003 11:59 To: Struts Users Mailing List Subject: Re: request.setAttribute 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

Re: request.setAttribute

2003-11-28 Thread Honza Spurn
To: Struts Users Mailing List Subject: Re: request.setAttribute 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

RE: request.setAttribute

2003-11-28 Thread Paul McCulloch
Please send some real code. I think you may have over simplfified what you are showing us. Paul -Original Message- From: Honza Spurn [mailto:[EMAIL PROTECTED] Sent: 28 November 2003 12:09 To: Struts Users Mailing List Subject: Re: request.setAttribute Paul McCulloch wrote

Re: request.setAttribute

2003-11-28 Thread Honza Spurn
is in the Server class, since it has about 125 attributes (each attribute has setter and getter method), so this object is realy huge... -Original Message- From: Honza Spurn [mailto:[EMAIL PROTECTED] Sent: 28 November 2003 12:09 To: Struts Users Mailing List Subject: Re: request.setAttribute

RE: request.setAttribute

2003-11-28 Thread Paul McCulloch
- From: Honza Spurn [mailto:[EMAIL PROTECTED] Sent: 28 November 2003 12:22 To: Struts Users Mailing List Subject: Re: request.setAttribute Paul McCulloch wrote: Please send some real code. I think you may have over simplfified what you are showing us. Paul No no, this is realy all

Re: request.setAttribute

2003-11-28 Thread Honza Spurn
Mailing List Subject: Re: request.setAttribute Paul McCulloch wrote: Please send some real code. I think you may have over simplfified what you are showing us. Paul No no, this is realy all :) look: public final class CreateServerAction extends Action { public ActionForward execute

RE: request.setAttribute

2003-11-28 Thread Paul McCulloch
is going to work. Try using different classes instead of Server - I'd start with String. Paul -Original Message- From: Honza Spurn [mailto:[EMAIL PROTECTED] Sent: 28 November 2003 12:33 To: Struts Users Mailing List Subject: Re: request.setAttribute Paul McCulloch wrote: The request

Re: request.setAttribute

2003-11-28 Thread Jos Ventura
, 2003 10:38 AM Subject: RE: request.setAttribute I'd concentrate on the bit of code in your action: request.setAttribute(serverBean, new Server()); Server s = (Server)request.getAttribute(serverBean); if (s == null) System.out.println(s.getWmId()); else System.out.println

Re: request.setAttribute

2003-11-28 Thread Honza Spurn
AM Subject: RE: request.setAttribute I'd concentrate on the bit of code in your action: request.setAttribute(serverBean, new Server()); Server s = (Server)request.getAttribute(serverBean); if (s == null) System.out.println(s.getWmId()); else System.out.println(null

RE: request.setAttribute

2003-11-28 Thread Kalra, Ashwani
Have you read other posts You are storing and retrieving by different names. /Ashwani -Original Message- From: Honza Spurný [mailto:[EMAIL PROTECTED] Sent: Friday, November 28, 2003 5:15 PM To: Struts Users Mailing List Subject: Re: request.setAttribute Shyam Krishnan wrote: Why you

Re: [SIDEBAR] Form population (Was RE: request.setAttribute() for mconfusion)

2002-11-12 Thread Eddie Bush
Martin Cooper wrote: -Original Message- From: Eddie Bush [mailto:ekbush;swbell.net] Sent: Monday, November 11, 2002 2:46 PM To: Struts Users Mailing List Subject: Re: [SIDEBAR] Form population (Was RE: request.setAttribute() form confusion) Sri, pardon me, but I don't see how what

Re: [SIDEBAR] Form population (Was RE: request.setAttribute() for mconfusion)

2002-11-12 Thread Eddie Bush
[mailto:martin.cooper;tumbleweed.com] Sent: Monday, November 11, 2002 9:40 PM To: 'Struts Users Mailing List' Subject: RE: [SIDEBAR] Form population (Was RE: request.setAttribute() for m confusion) I think you missed the point here, Eddie (or perhaps I missed that you didn't miss the point

RE: [SIDEBAR] Form population (Was RE: request.setAttribute() for m confusion)

2002-11-12 Thread Sri Sankaran
?? Are you telling me that I missed something fundamental to Struts?...'tis quite likely. Sri -Original Message- From: Eddie Bush [mailto:ekbush;swbell.net] Sent: Tuesday, November 12, 2002 11:34 AM To: Struts Users Mailing List Subject: Re: [SIDEBAR] Form population (Was RE: request.setAttribute

RE: [SIDEBAR] Form population (Was RE: request.setAttribute()for m confusion)

2002-11-12 Thread Martin Cooper
-Original Message- From: Sri Sankaran [mailto:Sri.Sankaran;sas.com] Sent: Tuesday, November 12, 2002 7:56 AM To: Struts Users Mailing List Subject: RE: [SIDEBAR] Form population (Was RE: request.setAttribute() for m confusion) No sweat. The reason this discussion got so

RE: [SIDEBAR] Form population (Was RE: request.setAttribute() for m confusion)

2002-11-12 Thread edgar
] Sent: Tuesday, November 12, 2002 10:56 AM To: 'Struts Users Mailing List' Subject: RE: [SIDEBAR] Form population (Was RE: request.setAttribute() for m confusion) No sweat. The reason this discussion got so off whack was because I tried to slam a square peg in a round hole by continuing

Re: [SIDEBAR] Form population (Was RE: request.setAttribute() for mconfusion)

2002-11-12 Thread Eddie Bush
Martin Cooper wrote: Huh? What's not terribly important? If I don't have the form bean (which Struts has not yet created for me), how am I going to populate it with the values I want displayed in the form? It's irrelevant whether or not the form is created if you haven't drawn the association

Re: [SIDEBAR] Form population (Was RE: request.setAttribute() for mconfusion)

2002-11-12 Thread Eddie Bush
Sri Sankaran wrote: No sweat. The reason this discussion got so off whack was because I tried to slam a square peg in a round hole by continuing with Kris' example (Edit Save actions) to make my point -- bad idea. So what *is* my scenario? Consider for example, a master-detail pair of

RE: [SIDEBAR] Form population (Was RE: request.setAttribute() form confusion)

2002-11-12 Thread Craig R. McClanahan
: request.setAttribute() for m confusion) -Original Message- From: Sri Sankaran [mailto:Sri.Sankaran;sas.com] Sent: Tuesday, November 12, 2002 7:56 AM To: Struts Users Mailing List Subject: RE: [SIDEBAR] Form population (Was RE: request.setAttribute() for m confusion

RE: [SIDEBAR] Form population (Was RE: request.setAttribute() for m confusion)

2002-11-12 Thread Sri Sankaran
Intermixed response... -Original Message- From: Eddie Bush [mailto:ekbush;swbell.net] Sent: Tuesday, November 12, 2002 2:34 PM To: Struts Users Mailing List Subject: Re: [SIDEBAR] Form population (Was RE: request.setAttribute() for m confusion) Sri Sankaran wrote: No sweat

RE: [SIDEBAR] Form population (Was RE: request.setAttribute() for m confusion)

2002-11-12 Thread Sri Sankaran
Intermixed response... -Original Message- From: Craig R. McClanahan [mailto:craigmcc;apache.org] Sent: Tuesday, November 12, 2002 1:54 PM To: Struts Users Mailing List Subject: RE: [SIDEBAR] Form population (Was RE: request.setAttribute() for m confusion) See intermixed

Re: [SIDEBAR] Form population (Was RE: request.setAttribute() for mconfusion)

2002-11-12 Thread Eddie Bush
(waaay down there ...) Sri Sankaran wrote: Intermixed response... -Original Message- From: Eddie Bush [mailto:ekbush;swbell.net] Subject: Re: [SIDEBAR] Form population (Was RE: request.setAttribute() for m confusion) Sri Sankaran wrote: No sweat. The reason

RE: [SIDEBAR] Form population (Was RE: request.setAttribute()for m confusion)

2002-11-12 Thread Martin Cooper
Comments in here somewhere... -Original Message- From: Eddie Bush [mailto:ekbush;swbell.net] Sent: Tuesday, November 12, 2002 12:22 PM To: Struts Users Mailing List Subject: Re: [SIDEBAR] Form population (Was RE: request.setAttribute() for m confusion) (waaay down

Re: [SIDEBAR] Form population (Was RE: request.setAttribute() for mconfusion)

2002-11-12 Thread Eddie Bush
Martin Cooper wrote: Ahhh! The murky waters finally clear, and I understand where all the confusion is coming from. Sri and I are talking about one Action handling the request. Yes - but I've said before that if you had multiple forms involved you would have to make yourself responsible

RE: [SIDEBAR] Form population (Was RE: request.setAttribute() for m confusion)

2002-11-12 Thread Sri Sankaran
mega-snip/ ... you've got two of these back-to-back: MstrLdActn - MstrJsp - MstrSbmtActn - - DtlLdActn - DtlJsp - DtlSbmtActn a redirect passing mastid=54 ^ Ah! Action chaining -- I realize that is an option. Just don't let Craig see you doing this... ;) snip/

Re: request.setAttribute() form confusion

2002-11-11 Thread Susan Bradeen
Nevermind, answering my own question ... actions in the Struts examples don't use the second line of code, so the answer is no, you don't need the two together. Susan On 11/11/2002 01:34:16 PM Susan Bradeen wrote: If I have this code, which appears to be good practice, in the beginning of

Re: request.setAttribute() form confusion

2002-11-11 Thread Eddie Bush
You shouldn't ever have to create the form yourself if you: - declare the form-bean in your config file - use the name of the form you declared in the action mapping's name attribute form-bean name=myForm ... / ... action path=/somePath name=myForm ... / That should suffice. What you should

Re: request.setAttribute() form confusion

2002-11-11 Thread Kris Schneider
Susan, Here's a response to a different thread with the same type of code block: http://marc.theaimsgroup.com/?l=struts-userm=103669042429912w=2 I understand this type of approach is used in the example app, but I'd say it's anything but good practice. In general, if you have an action that's

[SIDEBAR] Form population (Was RE: request.setAttribute() form confusion)

2002-11-11 Thread Sri Sankaran
corresponding to page-2 and save the form-bean under this name in the appropriate scope. Is there a way around this issue? Sri -Original Message- From: Eddie Bush [mailto:ekbush;swbell.net] Sent: Monday, November 11, 2002 3:00 PM To: Struts Users Mailing List Subject: Re: request.setAttribute

RE: [SIDEBAR] Form population (Was RE: request.setAttribute() form confusion)

2002-11-11 Thread edgar
population (Was RE: request.setAttribute() form confusion) While that is true, other than in the case of blank forms, isn't it true that one rarely depends on Struts to auto-generate the form bean? If you are presenting data, the form is pre-populated with such data. This data is typically

Re: request.setAttribute() form confusion

2002-11-11 Thread Susan Bradeen
Thank you for the help Eddie and Kris. I've already got my action mapping set up just as you say to have them, so I'll go back to trusting Struts with the form creation. Susan On 11/11/2002 02:00:55 PM Kris Schneider wrote: Susan, Here's a response to a different thread with the same type

RE: [SIDEBAR] Form population (Was RE: request.setAttribute() form confusion)

2002-11-11 Thread Sri Sankaran
-Original Message- From: edgar [mailto:edgar;blue-moose.net] Sent: Monday, November 11, 2002 3:04 PM To: 'Struts Users Mailing List' Subject: RE: [SIDEBAR] Form population (Was RE: request.setAttribute() form confusion) Doesn't doing things the way you are suggesting spread the business logic

RE: [SIDEBAR] Form population (Was RE: request.setAttribute() form confusion)

2002-11-11 Thread Kris Schneider
] Form population (Was RE: request.setAttribute() form confusion) While that is true, other than in the case of blank forms, isn't it true that one rarely depends on Struts to auto-generate the form bean? If you are presenting data, the form is pre-populated with such data. This data

RE: [SIDEBAR] Form population (Was RE: request.setAttribute() form confusion)

2002-11-11 Thread Sri Sankaran
, 2002 4:17 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: [SIDEBAR] Form population (Was RE: request.setAttribute() form confusion) ...one rarely depends on Struts to auto-generate the form bean? If you changed rarely to almost always, I'd tend to agree with you ;-). I make

Re: [SIDEBAR] Form population (Was RE: request.setAttribute() formconfusion)

2002-11-11 Thread Eddie Bush
the form-bean under this name in the appropriate scope. Is there a way around this issue? Sri -Original Message- From: Eddie Bush [mailto:ekbush;swbell.net] Sent: Monday, November 11, 2002 3:00 PM To: Struts Users Mailing List Subject: Re: request.setAttribute() form confusion You shouldn't

RE: [SIDEBAR] Form population (Was RE: request.setAttribute() form confusion)

2002-11-11 Thread edgar
, November 11, 2002 3:12 PM To: 'Struts Users Mailing List'; Edgar Dollin Subject: RE: [SIDEBAR] Form population (Was RE: request.setAttribute() form confusion) Actually, the way I have tried to describe keeps business logic *entirely* out of the form-beans and uses them only as the medium of transporting

Re: [SIDEBAR] Form population (Was RE: request.setAttribute() formconfusion)

2002-11-11 Thread Eddie Bush
... why are you changing forms? Do you forward to the JSP or redirect? Unless you do something special in EditAction the form you are dealing with in JSP is form-A --- not form-B. That is irrelevant though - as the user will submit form-A and form-B will be created (if needed - assuming

Re: [SIDEBAR] Form population (Was RE: request.setAttribute() formconfusion)

2002-11-11 Thread Eddie Bush
My apologies - you were going after edgar - and rightfully so :-) edgar: Listen to Sri the wise ;-) Eddie Bush wrote: Sri, pardon me, but I don't see how what you've said has anything to do with the point I was making. My sole point is that the actual creation (instantiation) of the form

RE: [SIDEBAR] Form population (Was RE: request.setAttribute() form confusion)

2002-11-11 Thread edgar
OK Eddie, what do you use to model the business logic? -Original Message- From: Eddie Bush [mailto:ekbush;swbell.net] Sent: Monday, November 11, 2002 6:16 PM To: 'Struts Users Mailing List' Subject: Re: [SIDEBAR] Form population (Was RE: request.setAttribute() form confusion) My

Re: [SIDEBAR] Form population (Was RE: request.setAttribute() formconfusion)

2002-11-11 Thread Eddie Bush
... -Original Message- From: Eddie Bush [mailto:ekbush;swbell.net] Sent: Monday, November 11, 2002 6:16 PM To: 'Struts Users Mailing List' Subject: Re: [SIDEBAR] Form population (Was RE: request.setAttribute() form confusion) My apologies - you were going after edgar - and rightfully so

Re: [SIDEBAR] Form population (Was RE: request.setAttribute() formconfusion)

2002-11-11 Thread Mark Ayad
population (Was RE: request.setAttribute() formconfusion) edgar wrote: OK Eddie, what do you use to model the business logic? Classes which aren't dependant on Struts ;-) Seriously. Most everyone is going to tell you to build things in layers - aiming for low cohesion between them. Data

RE: [SIDEBAR] Form population (Was RE: request.setAttribute() form confusion)

2002-11-11 Thread edgar
do appreciate your comments. Thanks -Original Message- From: Eddie Bush [mailto:ekbush;swbell.net] Sent: Monday, November 11, 2002 7:01 PM To: 'Struts Users Mailing List' Subject: Re: [SIDEBAR] Form population (Was RE: request.setAttribute() form confusion) edgar wrote: OK Eddie, what

RE: [SIDEBAR] Form population (Was RE: request.setAttribute()for m confusion)

2002-11-11 Thread Martin Cooper
-Original Message- From: Eddie Bush [mailto:ekbush;swbell.net] Sent: Monday, November 11, 2002 2:46 PM To: Struts Users Mailing List Subject: Re: [SIDEBAR] Form population (Was RE: request.setAttribute() form confusion) Sri, pardon me, but I don't see how what you've said has

RE: [SIDEBAR] Form population (Was RE: request.setAttribute() for m confusion)

2002-11-11 Thread Sri Sankaran
: Martin Cooper [mailto:martin.cooper;tumbleweed.com] Sent: Monday, November 11, 2002 9:40 PM To: 'Struts Users Mailing List' Subject: RE: [SIDEBAR] Form population (Was RE: request.setAttribute() for m confusion) -Original Message- From: Eddie Bush [mailto:ekbush;swbell.net] Sent: Monday

Re: Request.setAttribute() and jsp

2001-11-23 Thread Viet Kevin
Check if in the forwards of your action you do not write a thing like this forward path=*** redirect=true/ Mohammed [EMAIL PROTECTED] wrote: Hello, in my action class I am setting in my request an object as follow: SourceBean sourcebean= new SourceBean(); sourcebean.setSource(

Re: Request.setAttribute() and jsp

2001-11-23 Thread Mohammed
23, 2001 3:24 PM Subject: Re: Request.setAttribute() and jsp Check if in the forwards of your action you do not write a thing like this forward path=*** redirect=true/ Mohammed [EMAIL PROTECTED] wrote: Hello, in my action class I am setting in my request an object as follow

Re: Request.setAttribute() and jsp

2001-11-23 Thread Mohammed
Thanks kevin . now it is working Mohammed - Original Message - From: Viet Kevin [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, November 23, 2001 3:24 PM Subject: Re: Request.setAttribute() and jsp Check if in the forwards of your action you do

RE: request.setAttribute(variable, value) bug

2001-09-25 Thread Hans Gilde
Sounds like a logic problem, are you sure that the logic in the action class isn't branching around the part where it adds the questions? Maybe if you send your code... -Original Message- From: Christophe Rikelynck [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 25, 2001 6:19 AM To: