attribute vs name on action in struts-config

2002-10-21 Thread Tony Baity

hi,

I did a little cut and paste with the example struts-config and came up with the 
following.

!-- First Test--
actionpath=/test/firstTest
   type=mil.army.mtmc.tops.twc.business.test.FirstTestAction
  attribute=firstTestForm
  scope=request
   validate=false
  forward name=success  path=/test/FirstTest.jsp/
/action

 I was chasing after ghosts all afternoon and night trying to find out why my form 
bean was not showing up finally, after about three dozen System.out.println lines 
in ActionServlet, RequestProcessor, ApplicationConfig. etc, I found that the formbean 
config mapping wants to use a getName() .

So I added the following to struts-config after the 'attribute=firstTestForm'

name=firstTestForm

... and everything came up roses

my happy little form is now sitting nice and pretty in my request scope...

So what's the diff between attribute and name. Especially since (I seem to recall) 
that the getAttribute will return name if attribute is null.

Sorry about not checking the archive before sending this out... but it is after 1:00 
AM and if I don't ask now I'll probably forget to look.

-Tony




-
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site


RE: attribute vs name on action in struts-config

2002-10-21 Thread James Mitchell
If I remember correctly, Craig answered this about 2 days ago.  Although it
may have been buried under an unrelated thread.

I always use name=, so I've never hit this problem.

Unless I'm mistaken, the attribute is YOU telling struts what name of the
ActionForm is stored under in some scope, and the name is what Struts should
use, if you have used put it there already.

HTH

James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org




 -Original Message-
 From: Tony Baity [mailto:tonybaity;yahoo.com]
 Sent: Tuesday, October 22, 2002 1:24 AM
 To: [EMAIL PROTECTED]
 Subject: attribute vs name on action in struts-config



 hi,

 I did a little cut and paste with the example struts-config and
 came up with the following.

 !-- First Test--
 actionpath=/test/firstTest
type=mil.army.mtmc.tops.twc.business.test.FirstTestAction
   attribute=firstTestForm
   scope=request
validate=false
   forward name=success  path=/test/FirstTest.jsp/
 /action

  I was chasing after ghosts all afternoon and night trying to
 find out why my form bean was not showing up finally, after
 about three dozen System.out.println lines in ActionServlet,
 RequestProcessor, ApplicationConfig. etc, I found that the
 formbean config mapping wants to use a getName() .

 So I added the following to struts-config after the
 'attribute=firstTestForm'

 name=firstTestForm

 ... and everything came up roses

 my happy little form is now sitting nice and pretty in my request scope...

 So what's the diff between attribute and name. Especially
 since (I seem to recall) that the getAttribute will return name
 if attribute is null.

 Sorry about not checking the archive before sending this out...
 but it is after 1:00 AM and if I don't ask now I'll probably
 forget to look.

 -Tony




 -
 Do you Yahoo!?
 Y! Web Hosting - Let the expert host your web site


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