【问题标题】:Getting error for Input Validator for org.owasp.esapi.errors.ValidationException获取 org.owasp.esapi.errors.ValidationException 的输入验证器错误
【发布时间】:2021-02-05 16:18:28
【问题描述】:

我有表达 Validator.Format=^(csv|excel|Csv|Escel|CSV|EXCEL)$

出现错误 org.owasp.esapi.errors.ValidatornException:输入无效。请符合正则表达式 ^(csv|excel|Csv|Escel|CSV|EXCEL)$,最大长度为 5

你能推荐一下吗

【问题讨论】:

  • @398701 你能解决这个问题吗

标签: csv validation owasp esapi


【解决方案1】:

这里没有足够的信息。您至少需要说出您使用的是什么版本的 ESAPI 并向我展示完整的异常消息。至少在最新版本的 ESAPI 中,这个异常只显示在这里,在 StringValidationRules.java 中为:

throw new ValidationException( context + ": Invalid input. Please conform to regex " + p.pattern() + ( maxLength == Integer.MAX_VALUE ? "" : " with a maximum length of " + maxLength ), "Invalid input: context=" + context + ", type(" + getTypeName() + ")=" + p.pattern() + ", input=" + input + (NullSafe.equals(orig,input) ? "" : ", orig=" + orig), context );

因此,为初学者显示该异常消息的其余部分。

【讨论】:

    猜你喜欢
    • 2014-07-11
    • 2018-07-01
    • 2022-01-23
    • 2016-06-01
    • 1970-01-01
    • 2014-06-04
    • 1970-01-01
    • 2021-06-19
    • 1970-01-01
    相关资源
    最近更新 更多