java - How can I trim whitespace from request parameters in Spring MVC -


i'm struggling believe need trim leading , trailing whitespace request parameters not common requirement, , yet can't seem find has answer solving it.

surely there simple way configure, say, spring webdatabinder trim whitespace parameter values before mapping them target object?

i'd keen know how other people have tackled this.

you can try registering custom propertyeditor in webdatabinder

 registercustomeditor(string.class, propertyeditor) 

either create 1 or use stringtrimmereditor, , instantiate set of whitespaces.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -