Struts 2 using StringUtils in validator expersions
问题 We are using Struts 2 validators @FieldExpressionValidator and @ExpressionValidator . These validators check on OGNL expression. There are lots of cases where we deal with Strings in these expressions. expression="(captcha=='' && captcha== null || ....) We find it is very useful if we can use StringUtils ( isEmpty ,trimToEmpty,... ) here. As we set the struts.ognl.allowStaticMethodAccess to false, for security issues, we tried to solve it by adding this getter to action public StringUtils