J2EE快速开发框架RoseForJ

J2EE 专栏收录该内容
1 篇文章 0 订阅

网站正式开通,请访问http://www.mobi99.cn CSDN上的内容不再更新,谢谢!

        RoseForJ是一个以快速开发为目标的J2EE的框架,前端用velocity作表示层,后台ActionEvent实现业务逻辑部分,Event类似AOP的功能,它在不影响原有功能的前提下扩充系统功能,其它数据的获取,与数据库的映射、事务控制、异常、日志、流程控制等功能都由框架完成,开发者只需要关注业务逻辑,框架中已完成对单表的增、删、改、查功能,对于复杂的查询,RoseForJ框架开发起来也是非常方便,只需几行代码就能完成,框架的整个使用过程都非常简单,不用象Hibernate等框架一样配置一堆的POVO和XML文件,从而达到快速开发的目地。

   一、RoseForJ系统结构

说明:蓝色箭头为上行流程,红色为下行流程,蓝色虚线为可选部分。

 

二、配置说明
 
1、默认配置文件名jasmine-config.xml,放在WEB-INFO/CLASSES/目录下,也可以指定文件名和路径,样例如下:
 
<? xml version = "1.0" encoding = "gb2312" ?>
< jasmine-config xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" >
    < action-mappings >
       < action path = "/*/list*" name = "list{2}Action" className = "juan.business.{1}.Get{2}ListAction" >
           < forward name = "fail" redirect = "false" contextRelative = "true" path = "/{1}/err{2}.jsp" />
           < forward name = "success" redirect = "false" contextRelative = "true" path = "/{1}/list{2}.jsp" />
       </ action >
       < action path = "/*/edit*" name = "edit{2}Action" className = "juan.business.general.GetGeneralEditAction" >
           < forward name = "fail" redirect = "false" contextRelative = "true" path = "/{1}/err{2}.jsp" />
           < forward name = "success" redirect = "false" contextRelative = "true" path = "/{1}/edit{2}.jsp" />
       </ action >
       < action path = "/*/save*" name = "save{2}Action" className = "juan.business.general.SaveGeneralAction" >
           < forward name = "fail" redirect = "false" contextRelative = "true" path = "/{1}/err{2}.jsp" />
           < forward name = "success" redirect = "false" contextRelative = "true" path = "/{1}/list{2}.do" />
       </ action >
       < action path = "/*/delete*" name = "delete{2}Action" className = "juan.business.general.DeleteGeneralAction" >
           < forward name = "fail" redirect = "false" contextRelative = "true" path = "/{1}/err{2}.jsp" />
           < forward name = "success" redirect = "false" contextRelative = "true" path = "/{1}/list{2}.do" />
       </ action >
    </ action-mappings >
    < event-mappings >
       < action-event actionname = "delete_{1}Action" >
           < event order = "0" invokeType = "before" className = "juan.business.operation.{1}Event" />
           < event order = "1" invokeType = "before" className = "juan.business.operation.{1}OrderEvent" />
           < event order = "0" invokeType = "after" className = "juan.business.operation.{1}Event" />
       </ action-event >
       < action-event actionname = "editTopicAction" >
           < event order = "0" invokeType = "after" className = "juan.demo.event.{2}Event" />
       </ action-event >
    </ event-mappings >
    <!--transaction className="juan.transaction.JTransaction"/-->
</ jasmine-config >
2.web配置文件(web.xml
 
<? xml version = "1.0" encoding = "UTF-8" ?>
< web-app id = "WebApp_ID" version = "2.4" xmlns = "http://java.sun.com/xml/ns/j2ee" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
    < display-name > RoseForJ </ display-name >
    < welcome-file-list >
       < welcome-file > index.jsp </ welcome-file >
       < welcome-file > default.jsp </ welcome-file >
    </ welcome-file-list >
    < resource-ref >
       < res-ref-name > jdbc/defaultdb </ res-ref-name >
       < res-type > javax.sql.DataSource </ res-type >
       < res-auth > Container </ res-auth >
       < res-sharing-scope > Shareable </ res-sharing-scope >
    </ resource-ref >   
    < filter >
       < filter-name > CharacterEncoding </ filter-name >
       < filter-class > juan.web.filter.EncodingFilter </ filter-class >
       < init-param >
           < param-name > encoding </ param-name >
           < param-value > GB2312 </ param-value >
       </ init-param >
       < init-param >
           < param-name > ignore </ param-name >
           < param-value > true </ param-value >
       </ init-param >
    </ filter >
    < filter-mapping >
       < filter-name > CharacterEncoding </ filter-name >
       < url-pattern > /* </ url-pattern >
    </ filter-mapping >
    < servlet >
       < servlet-name > ActionServlet </ servlet-name >
        < servlet-class > juan.framework.ActionServlet </ servlet-class >
<!— 可选,默认在 WEB INFO CLASSES /目录下,也可以通过以下配置指定位置
        < init-param >
           < param-name > resource.config.path </ param-name >
           < param-value > d://workspace//RoseForJ//src//jasmine-config.xml </ param-value >
       </ init-param >
-->
<!-- 可选,默认为 tomcat 下数据链接池 jdbc/defaultdb
       < init-param >
           < param-name > default.jndi </ param-name >
           < param-value > java:comp/env/jdbc/defaultdb </ param-value >
       </ init-param >
-->
       < load-on-startup > 1 </ load-on-startup >
    </ servlet >
    < servlet-mapping >
        < servlet-name > ActionServlet </ servlet-name >
        < url-pattern > *.do </ url-pattern >
    </ servlet-mapping >
    < jsp-config >
       < taglib >
          < taglib-uri > veltag </ taglib-uri >
          < taglib-location > /WEB-INF/veltag.tld </ taglib-location >
        </ taglib >
    </ jsp-config >
</ web-app >
下载地址:RoseForJ.rar
  • 1
    点赞
  • 1
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值