<p>I use Struts v1.3 and have following input form:</p>

<p>In struts-config.xml:</p>

<pre><code>    &lt;form-bean name="testForm" 
               type="org.apache.struts.validator.DynaValidatorForm"&gt;
        &lt;form-property name="displayName" type="java.lang.String" /&gt;
    &lt;/form-bean&gt;
</code></pre>

<p>In validation.xml:</p>

<pre><code>    &lt;form name="testForm"&gt;
        &lt;field property="displayName" depends="required"&gt;
            &lt;arg key="input.displayName" /&gt;
        &lt;/field&gt;
    &lt;/form&gt;
</code></pre>

<p>How do I trim value of "displayName"? How do I trim values of all "java.lang.String" input fields of the form?</p>

You may have a chance to trim the string right at the moment, the request processor updates the data from the input fields to the form. This was not tested, but what happens when you modify the setter setDisplayName(String displayName) to something like
```
```
public void setDisplayName(String displayName) {
    this.displayName = displayName.trim();
}
```
```
This is not a very good solution, because it migrates logic into a setter.
regards