TECTED]>
To:
Sent: Wednesday, January 10, 2007 9:05 PM
Subject: Re: Trimming Form Input
> What about making the map-processor operation automatically trim
> values that are String objects? Although there may be cases where you
> don't want this... maybe add an attribute called &quo
David,
I'm trying to understand the advantage of your suggestions over Joe's
original suggestion?
Can you elaborate a little please?
It seems this is only a problem with input from html forms so simple-
map-processor is an obvious choice for a place to deal with it
Sorry if this is a stupid que
What about making the map-processor operation automatically trim
values that are String objects? Although there may be cases where you
don't want this... maybe add an attribute called "preserve-whitespace"
in addition to "set-if-null" and "replace"?
(I realize this won't fix the createPerson
Good question. I guess it depends on how universal we want to make
this. For doing it manually I can think of a couple of ways to handle
it in simple-methods:
1. add a trim-entries operation to trim all entries in a Map or List
2. add a trim attribute to the set operation, the set-*-fields
Depends on what you're using to process/validate the
form.
In javascript to validate/process on the client side
something like:
var str = " this is a test ";
str = str.replace(/^\s*|\s*$/g,"");
If you're passing it to validate/process on the server
side
in java
str.trim()
or in
What would be the best way to trim form input that is passed to stock
ofbiz services like "createPerson" and "createPostalAddress"? Add a new
operation to the simple-map-processors? Use an entity ECA? I'd
like to avoid creating people with names like "John ", " Doe ", etc.
and address lines