In fact, Java Web Parts has such a filter:

http://http://javawebparts.sourceforge.net/javadocs/javawebparts/filter/ParameterMungerFilter.html

And in fact, if you wanted to do it client-side, JWP can help there too:

http://javawebparts.sourceforge.net/javadocs/javawebparts/taglib/jstags/FullTrimTag.html

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

On Thu, January 26, 2006 12:27 pm, Tamas Szabo said:
> On 1/27/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
>>
>> On 1/26/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> > When struts takes the data from the request and populates your form,
>> > does it automatically trim whitespace?  I think this might be answered
>> > from the particulars of HTML rather than struts.  Perhaps the question
>> > is really whether html trims whitespace before building the request.
>> If
>> > id doesn't, does struts?
>>
>> Nope, neither Struts nor your browser (HTML) trims whitespace on the
>> data
>> it submits.  It really wouldn't be correct if either did because it
>> would
>> then not be an accurate representation of what was entered by the user
>> (or
>> transmitted by the client if its another machine).  I mean, if someone
>> enters "   Hello   " instead of "Hello", who's to say the first should
>> be
>> transformed to the second?  You may have a use case that says those are
>> two distinct values that you have to be able to differentiate.  It might
>> be nice if you could tell Struts (or the browser) to automatically trim
>> all parameters, but as it is today, you cannot, you will have to write
>> the
>> code to do this, either on the client or the server.
>
>
> You could probably define and register a Converter that does the trimming
> for you.
> Or you coud use a Filter.
>
> These apply if you want to handle it on hte server side...
>
> Tamas
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to