常用 Java 工具包,Jodd 3.5 发布

jopen 10年前

Jodd是一个开放源码的Java工具库和一套框架。 Jodd工具丰富和增强了JDK现有的许多功能。可以使代码更加强大和可靠。 Jodd框架是一套轻量级应用程序框架,紧凑而强大。设计遵循 CoC, DRY 和 SCS原则 ,使得开发更简单。它已经实现90%的功能,通常你只需要再用10%的努力。

Jodd 提供的功能有:

1. 提供操作Java bean,
2. 可以从各种数据源加载Bean,
3. 简化JDBC的接连与代码,
4. 剖析SQL查询,
5. 处理时间与日期,
6. 操作与格式化String,
7. 搜索本地硬盘上的文件,
8. 帮助处理Servlet请求等。
经过两个月的努力,辛酸和喜悦,新版本的Jodd闪亮登场!!这和那些无私的贡献者是分不开的,Jodd因此而更变的更好。希望你能喜欢这个新版本更优美的操作。

这个版本包含了一些重要更改,但是迁移并不麻烦 ;)
如果遇到什么问题,欢迎反馈给我们。

[2014-02-22] 3.5 更新记录
【修复】 Generated table references appends '_' in DbOom.
【新增】 Added GenericDao to DbOom.
【新增】 Added @DbMapTo annotation (incubation feature).
【修改】 ReferenceMap removed.
【新增】 Added JSPP - JSP pre-processor (incubation feature).
【修 改】 Result paths now include the path as well! ATTENTION: your app may break if you were using # in your results - try to put one more #, since there is one more path chunk to skip.
【修改】 Removed default aliases in Madvoc.
【修改】 Removed ActionPathMapper in Madvoc.
【新增】 Added Result to Madvoc for easier referencing target paths.
【修改】 Methref simplified.
【修改】 ActionResult#render significantly simplified.
【修改】 Removed @Action#result as not really needed for Madvoc.
【新增】 Added @RenderWith annotation fro Madvoc. Return values now can specify result class.
【修改】 In Madvoc, ActionResult is not interface any more.
【修复】 Fixed some encoding-related issues with email addresses.
【新增】 Added 'keep-alive' support for Http.
【新增】 Added RequestScope for Petite.
【新增】 Printf has new 0b prefix.
【修复】 Some Printf issues with printing and rounding float numbers fixed.
【修改】 Removed DefaultScope setting for Petite.
【新增】 Added destroyable methods for Petite.
【修改】 Added SessionMonitor instead of SessionMapListener.
【修复】 Fixed some gzip encoding problems with Http.
【修改】 Removed Madvoc supplement actions as they may fill up the memory.
【新增】 Added copy operator for Props.
【新增】 Added useActiveProfilesWhenResolvingMacros for Props.
【新增】 Minor change in GZipFilter, allow to match all extensions.
【新增】 Http supports various PROXYs.
【修改】 SessionScope now works only with RequestContextListener!
【新增】 Added connection provider for Http.
【新增】 Added jodd-log module and removed direct dependency on 'slf4j'. Now all logging is done via our module.
【修改】 Removed bean loaders. Use BeanCopy tool instead.
【修 改】 Removed JSP functions. There were too many functions, users instead should define custom JSP functions using our utilities.

ActionResult 迁移指南(非官方,由 @webit 提供)

 1. 原有的ActionResult已成为一个接口而不是抽象类,请更改继承BaseActionResult

 2. render方法去除后两个参数 String resultValue, String resultPath

3. 如果需要resultPath参数,如:
public class MyResult extends BaseActionResult<String> {            public static final String NAME = "wit";            @In(scope = ScopeType.CONTEXT)      protected ResultMapper resultMapper;            public WebitScriptResult() {          super(NAME);      }            @Override      public void render(final ActionRequest actionRequest, final String resultValue) throws Exception {          //...                    //得到Jodd Style 的 resultPath          String resultPath = resultMapper.resolveResultPath(actionRequest.getActionPath());          //...      }  }