[ 
http://www.stripesframework.org/jira/browse/STS-394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11165#action_11165
 ] 

Tim Fennell commented on STS-394:
---------------------------------

Just capturing an email I sent to the mailing list:

So we were chatting about this on IRC in the context of some other stuff, and I 
realized that there's actually a fairly nice way to do this if you don't mind 
extending one of Stripes' components. Basically it'd look like this:

public class MyPropertyBinder extends DefaultActionBeanPropertyBinder {
    @Override
    protected SortedMap<ParameterName, String[]> 
getParameters(ActionBeanContext ctx) {
        SortedMap<..> params = super.getParameters(ctx);
        for (String[] values : params.values()) {
            for (int i=0; i<values.length; ++i) {
                values[i] = values[i].trim();
            }
        }

        return params;
    }
}

You'd just then need to configure your new Binder as the one for Stripes to use 
and you should be all set.



> Validator doesnot trim the value entered before doing validation 
> -----------------------------------------------------------------
>
>                 Key: STS-394
>                 URL: http://www.stripesframework.org/jira/browse/STS-394
>             Project: Stripes
>          Issue Type: Bug
>          Components: Validation
>         Environment: All browsers, Operating System - Window XP.
>            Reporter: PAT
>
> We have a text box and for that value provided a default validation saying 
> (required=true), in this case non-null, non-empty value must be submitted for 
> the field. When we donot provide a value proper validation happens and error 
> message is dispalyed. But if we provide blank spaces and submit the form; no 
> validation error is submitted.
> In the above case if proper trimmig is done then proper validation will be 
> done.
> So I guess before validating  'Trimming' of value has also to be done. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to