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中的验证框架
基础教程推荐
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 降序排序:Java Map 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01