From my reading on ModelDriven, it seems that will just push my issue to the Model object, instead of the Action. Struts will still look for getFred1(), getFred2() etc on the Model object.

mitch



On 05/11/2011 02:12 PM, CRANFORD, CHRIS wrote:
Look at the ModelDriven approach


----- Original Message -----
From: Mitch Claborn<mitch...@claborn.net>
To: user@struts.apache.org<user@struts.apache.org>
Sent: Wed May 11 14:03:33 2011
Subject: Retrieving values for which there is no specific getter

In Struts 2, if my Action class has a variable named "fred" and a getter
"getFred()", a<s:textfield name="fred" />  will call that getter to
retrieve the value from the action.

Is there some kind of catch-all or generic method that is called to
retrieve the value for a form field if there is no specific getter?  For
example, I might have
<s:textfield name="fred1" />
<s:textfield name="fred2" />
...
<s:textfield name="fred100" />

I don't want to code a specific getter for each one.

I thought I saw some documentation on the sequence of methods that are
attempted, but can't find it now.

Mitch

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



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

Reply via email to