How to trim request parameters automatically in playframework
Play will assign the parameters from request to action parameters, like: public static void createArticle(String title, String content) { } But it won't trim them, so we usually to such code in the actions: public static void createArticle(String title, String content) { if(title!=null) title = title.trim(); if(content!=null) content = content.trim(); } Is there any way to let play trim them automatically? There are multiple ways to achive this with custom binders. One way of doing would be this: Define acustom binder somewhere that trims the string Annotate every parameter you want to trim