Validation Framework in Java(Java中的验证框架)
问题描述
我们目前正在重构我们的插件 API**(JDK 1.4 兼容)**,它以 jar 文件的形式发送给我们的客户(即,不需要生成 javascript 等等)).这是一个非常轻量级的插件,因此我们像 Spring 一样保留了尽可能多的依赖 jar.在此过程中,我们开始了解需要有一个适当的验证方法,该方法由一些验证框架提供支持.奇怪的是,除了 Commons Validator、Drools 和 Spring 支持等少数几个选项外,我在这些行中找不到太多选项(就像其他开源项目一样).
We are currently in the process of refactoring our plugin API**(JDK 1.4 compliant)** which is shipped to our clients in the form of a jar file(ie, no need to have javascripts to be generated and so forth). This is a very lightweight plugin so that we have kept away as many dependent jars as possible like Spring. During this process we started to understand the need to have a proper validation methodology which is faciliated by some validation Framework. Strangly, I couldnt find much options in these lines (like other open source projects)apart from a few such as Commons Validator,Drools and Spring support.
对于我的需求,Drools 似乎太复杂了.然而,Commons 验证器的验证方式看起来是史前的.
Drools seems to be so complex for my needs. However Commons validator looks prehistoric in its style of validation.
我不能使用基于注释的验证,因为它必须是 JDK 1.4,并且更喜欢可以外部化的东西,因此在发生变化时不需要再次编译类.
I cannot use annotation based validation cause it has to be JDK 1.4 and would prefer something that could be externalized thereby not requiring to compile classes again in case of changes.
有更好的选择吗?
推荐答案
XWork 验证系统在当时相当不错,但我已经快 3 年没有使用它了.我很确定它被设计为完全独立的,但也与 WebWork 的其余部分一起被整合到 Struts 2 中.信息在这里:
The XWork validation system was pretty decent back in the day but I haven't used it for almost 3 years now. I'm quite certain it was designed to be totally standalone but has also been rolled into Struts 2 along with the rest of WebWork. Info is here:
http://www.opensymphony.com/xwork/wikidocs/Validation%20Framework.html
这篇关于Java中的验证框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Java中的验证框架


- Eclipse 插件更新错误日志在哪里? 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01