I know struts2 default config will trim all strings obtained from forms.
For example:
I type
\" whatever \"
register this property editor: org.springframework.beans.propertyeditors.StringTrimmerEditor
Example for AnnotionHandlerAdapter:
... ...