struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mitch Claborn <>
Subject input fields with dynamic names
Date Wed, 28 Apr 2010 16:47:54 GMT
I'm sure I've seen the answer to this somewhere, but darned if I can 
find it now when I need it!

I have a page that allows edits of various options, the names of which 
are dynamically retrieved from the database.  If I have the code in the 
JSP as below, the value displayed in the text field is always that from 
the database.  If there is a validation error, the user's input value is 
not maintained as it would be if there were an explicit getter/setter 
for each option name.  Is there a way to code the Action (or the JSP) so 
that the value shown is the user's input value if there is an error?

          <s:iterator value="authorizedOptions" id="o">
                  <s:textfield size="10" name="${o.optionName}" 
id="${o.optionName}" value="${o.valueInt}" />


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message