ssh 搭建
来源:互联网 发布:java工程师的简历模板 编辑:程序博客网 时间:2024/05/22 07:56
------- android培训、java培训、期待与您交流! ----------
struts2:
web程序的框架.
基于filter=StrutsPreparedAndExecuteFilter.
struts1 + webwork ;
耦合度松(和servlet api)
分离关注:sperate aware,拦截器(aop),更加整洁mvc框架.
action:原型,线程安全(threadlocal,数据安全).独占.
synchronized:同步.
spring:业务层的框架,
ioc:inverse of control,反转控制.获得依赖对象的方式.容器
DI:dependency injection,依赖注入.
aop:aspect oriented program,面向切面编程.不改变源代码,还增加新功能。
aspect:切面
通知:
连接点:
切入点:真正的
目标对象:
代理:
jdk动态代理-接口代理,松耦合.
cglib -对类代理,final
service层面事务管理.aop,环绕.
事务属性:5
1.传播行为.
2.隔离级别:脏读 | 不可重复读 | 幻读(虚读)
1:读未提交
2:读已提交 oracle
4:可以重复读 mysql
8:串行化
3.只读:优化
4.超时:释放资源
5.回滚规则:
advice:MethodBeforeAdvice|AfterReturiningAdvice|MethodInterceptor,行为
pointcut:切入点.
advisor:切入点 + 通知
hibernate:
持久化技术,封装了数据访问细节,体现了oop.hql
ORM:object relation mapping.
搭建项目:
1.创建web项目
2.引入类库
struts2
asm-3.3.jar
asm-commons-3.3.jar
asm-tree-3.3.jar
commons-fileupload-1.2.2.jar
commons-io-2.0.1.jar
freemarker-2.3.18.jar
javassist-3.11.0.GA.jar
ognl-3.0.4.jar
struts2-core-2.3.1.2.jar
xwork-core-2.3.1.2.jar
hibernate
antlr-2.7.6.jar
dom4j-1.6.1.jar
freemarker-2.3.18.jar
hibernate3.jar
javassist-3.11.0.GA.jar
jta-1.1.jar
log4j.jar
ognl-3.0.4.jar
slf4j-api-1.5.8.jar
slf4j-log4j12.jar
struts2-core-2.3.1.2.jar
xwork-core-2.3.1.2.jar
spring
com.springsource.net.sf.cglib-2.2.0.jar
com.springsource.org.aopalliance-1.0.0.jar
com.springsource.org.apache.commons.logging-1.1.1.jar
com.springsource.org.aspectj.tools-1.6.6.RELEASE.jar
com.springsource.org.aspectj.weaver-1.6.8.RELEASE.jar
org.springframework.aop-3.1.0.RELEASE.jar
org.springframework.asm-3.1.0.RELEASE.jar
org.springframework.aspects-3.1.0.RELEASE.jar
org.springframework.beans-3.1.0.RELEASE.jar
org.springframework.context-3.1.0.RELEASE.jar
org.springframework.context.support-3.1.0.RELEASE.jar
org.springframework.core-3.1.0.RELEASE.jar
org.springframework.expression-3.1.0.RELEASE.jar
org.springframework.jdbc-3.1.0.RELEASE.jar
org.springframework.orm-3.1.0.RELEASE.jar
org.springframework.transaction-3.1.0.RELEASE.jar
org.springframework.web-3.1.0.RELEASE.jar
driver
mysql-connector-java-5.0.8-bin.jar
dataSource
com.springsource.com.mchange.v2.c3p0-0.9.1.2.jar
struts2-spring整合:
struts2-spring-plugin-2.3.1.2.jar
3.创建包结构
cn.itcast.dao.impl
cn.itcast.domain
cn.itcast.service.impl
cn.itcast.struts2.action
cn.itcast.util
4.创建配置
struts
---------------------
[web.xml]
<!-- 通过上下文参数指定spring指定配置文件的位置 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:beans.xml</param-value>
</context-param>
<!-- 配置spring上下文载入器监听器,确保服务器启动时同时完成spring容器的初始化,放到Application范围中 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- 配置struts2过滤器 -->
<filter>
<filter-name>action</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>action</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
[conf/struts.xml]
<?xml version="1.0"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN"
"http://struts.apache.org/dtds/struts-2.1.7.dtd">
<struts>
<package name="test" namespace="/" extends="struts-default">
</package>
</struts>
spring
---------------------
<?xml version="1.0"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd ">
<!-- 指定分散配置的文件 -->
<context:property-placeholder location="classpath:jdbc.properties"/>
<!-- 配置数据源 -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="${jdbc.driverclass}" />
<property name="jdbcUrl" value="${jdbc.url}" />
<property name="user" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<property name="maxPoolSize" value="${c3p0.pool.size.max}" />
<property name="minPoolSize" value="${c3p0.pool.size.min}" />
<property name="initialPoolSize" value="${c3p0.pool.size.ini}" />
<property name="acquireIncrement" value="${c3p0.pool.size.increment}" />
</bean>
<!-- 本地会话工厂bean,spring整合hibernate和核心入口 -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<!-- 配置hibernate自身属性 -->
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2dd.auto}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
</props>
</property>
<!-- 映射目录位置集 -->
<property name="mappingDirectoryLocations">
<list>
<value>classpath:cn/itcast/surveypark/domain</value>
</list>
</property>
</bean>
<!-- hibernate事务管理器,在service层面上实现事务管理,到达平台无关性 -->
<bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<!-- 事务通知 -->
<tx:advice id="txAdvcie" transaction-manager="txManager">
<tx:attributes>
<tx:method name="save*" propagation="REQUIRED" isolation="DEFAULT" />
<tx:method name="update*" propagation="REQUIRED" isolation="DEFAULT" />
<tx:method name="delete*" propagation="REQUIRED" isolation="DEFAULT" />
<tx:method name="batch*" propagation="REQUIRED" isolation="DEFAULT" />
<tx:method name="get*" propagation="REQUIRED" isolation="DEFAULT" read-only="true"/>
<tx:method name="load*" propagation="REQUIRED" isolation="DEFAULT" read-only="true"/>
<tx:method name="find*" propagation="REQUIRED" isolation="DEFAULT" read-only="true"/>
<tx:method name="*" propagation="REQUIRED" isolation="DEFAULT"/>
</tx:attributes>
</tx:advice>
<!-- aop配置 -->
<aop:config>
<aop:advisor advice-ref="txAdvcie" pointcut="execution(* *..*Service.*(..))"/>
</aop:config>
</beans>
- ssh搭建
- 【SSH】搭建
- ssh 搭建
- ssh 搭建
- SSH搭建
- ssh搭建
- ssh 搭建
- SSH搭建
- SSH搭建
- SSH搭建
- SSH搭建
- SSH搭建
- 搭建ssh
- SSH框架搭建
- maven搭建ssh
- ssh框架搭建问题解决
- ssh框架搭建
- 快速搭建ssh框架
- Data URI explained, URI 不是URL啊?
- struct 定义
- div 内容溢出 不换行处理
- GSM 03.38 from Wikipedia
- 关闭Weblogic的基本认证
- ssh 搭建
- elasticsearch中概念
- 完美解决多应用服务器负载均衡环境下spring quartz同一定时任务重复执行问题
- iOS 多线程 锁 互斥 同步
- ios 国际化(项目名和内容)
- 探索Android 下拉刷新效果的实现
- Silverlight5在Tomcat上的部署
- MotionEvent事件在onInterceptTouchEvent()、onTouchEvent()中的传递顺序
- libmad MP3解码