读书人

SSH2项目筹建

发布时间: 2012-12-26 14:39:29 作者: rapoo

SSH2项目搭建
之前说了一下我所写的这个SSH2 OA项目所用的框架与工具.今天就来总结一下从搭建SSH2开发环境的过程到即将发布的机构管理这个小模块开发的实现思路.
我所做这个项目的目的是来巩固复习Hibernate 和Spring这两个框架(Struts2一只在用).其基本思路和架构也都想好了,也打算利用晚上下班的时间来做出来.想法赶不上计划啊!这段时间有一些其他的事情,再者感觉身体不是怎么好,情绪也受到影响,可能之后就抽出空去搞了.这里就把前几天所写的来公布于众.供大家学习.由于我也是刚刚参加工作,也没什么开发经验.代码写的有不足的地方请大家提出宝贵的意见与见解.
1.首先是搭建环境
虽然我是的是MyEclipse来开发,但我没有借助MyEclipse来帮助我,我全部是手动的方式来构建SSH2环境的.其三个框架所依赖的jar没有一个多余的,做到jar依赖的最小化.

整个项目架构是:


下面是application.xml中的(applicationcontext-common.xml)关键代码:

<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"><!-- 配置sessionFactory --><bean id="sessionFactory" transaction-manager="transactionManager"><tx:attributes><tx:method name="add*" propagation="REQUIRED"/><tx:method name="delete*" propagation="REQUIRED"/><tx:method name="modify*" propagation="REQUIRED"/><tx:method name="*" read-only="true"/></tx:attributes></tx:advice><!-- 那些类的哪些方法参与事务 --><!--<aop:config><aop:advisor pointcut="execution(* com.oa.manager.*.*(..))" advice-ref="txAdvice"/></aop:config>--> <!-- 配置那些类的方法进行事务管理,当前com.oa.manager包中的子包, 类中所有方法需要,还需要参考tx:advice的设置 --><aop:config><aop:pointcut id="allManageMethod" expression="execution(* com.oa.manager.*.*(..))" /><aop:advisor pointcut-ref="allManageMethod" advice-ref="txAdvice"/></aop:config>    <!-- 那些类的哪些方法参与事务 --><!--<aop:config><aop:advisor pointcut="execution(* com.oa.manager.*.*(..))" advice-ref="txAdvice"/></aop:config>--></beans>

2.机构管理的功能实现:


代码我打包上传了,效果实现过程可以看我所写的代码.(不知道怎么搞的,它不让我上传了!!!)


10 楼 zhangjun460 2011-08-25 能不能发一份给我呢,我的邮箱 zhangjun460@sina.com 11 楼 li010457 2011-08-26 能给我一份吗?li010457@163.com,感谢 12 楼 zccmp 2011-08-29 能否发我一份源码呀?现在正在学习中...
zccmp@126.coom
非常感谢!!! 13 楼 tjl_1980 2011-08-31 能否发一份给我呢?邮箱:jianlin2003@163.com 谢谢 14 楼 23843492 2011-09-07 可以发一份你的源码给我吗?邮箱:23843492@qq.com 15 楼 mysecondgod 2011-10-19 麻烦给我也发一份,正在学习中,谢谢!mysecondgod@sina.com 16 楼 ccrao 2012-03-06 能否发一份到我学习,谢谢了 30589039@qq.com 17 楼 fly1989 2012-04-06 能给一份吗!!谢谢!fuzimin1989@126.com 18 楼 gzwsee 2012-04-19 能否发一份给我呢 邮箱是gzwsee@163.com 谢谢! 19 楼 taicheng 2012-04-19 能不能帮我也发一份 邮箱:tai13218101237@126.com 20 楼 tjl_1980 2012-04-20 能不能帮我也发一份 邮箱:36909323@qq.com 21 楼 studykeep 2012-04-25 求源码一份,现在正在学习中,1253060424@qq.com 22 楼 617726909 2012-05-02 求源码O(∩_∩)O谢谢了 617726909@qq.com 23 楼 fysoft2006 2012-05-11 求源码一份,谢谢! fysoft2006@163.com 24 楼 wmj191873254 2012-07-04 能给我发一份么,现在正在学习这方面的东西,最好数据库脚本带上.191873254@qq.com不胜感激! 25 楼 filer325 2012-07-09 发份源码吧,1029015316@qq.com,谢谢 26 楼 747953682 2012-07-11 发代码过来学习下,QQ:747953682,谢谢 27 楼 wzl4022561 2012-07-24 你好能给我发一份吗? 28 楼 wzl4022561 2012-07-24 417643066@qq.com 29 楼 K10692081 2012-09-13 求转发一份
10692081@qq.com

读书人网 >编程

热点推荐