struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "CRANFORD, CHRIS" <Chris.Cranf...@setech.com>
Subject Re: Retrieving values for which there is no specific getter
Date Wed, 11 May 2011 19:12:35 GMT
Look at the ModelDriven approach


----- Original Message -----
From: Mitch Claborn <mitch_ml@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-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message