Java验证框架 [英] Validation Framework in Java

查看:78
本文介绍了Java验证框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前正在重构我们的插件API **(符合JDK 1.4)**,它以jar文件的形式(即无需生成JavaScript等)发送给我们的客户).这是一个非常轻巧的插件,因此我们尽可能地避免了像Spring这样的依赖罐子.在此过程中,我们开始理解需要一种适当的验证方法的必要性,该方法将由某些验证框架提供帮助.遗憾的是,除了 Common 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.

对于我的需求,流口水似乎是如此复杂.但是,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验证系统在当时还算不错,但是我已经将近三年没有使用它了.我敢肯定,它的设计是完全独立的,但也已与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验证框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆