常用 Java 工具包,Jodd 3.5 發布

jopen 10年前發布 | 7K 次閱讀 Jodd

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

  9. 如果需要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());
     //...
    

    } }</pre>

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!