- 博客(20)
- 收藏
- 关注
转载 struts.xml
struts.xml 实例1:相应 客户端/页面 的请求进行的各种配置<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE struts PUBLIC "-//Apache Software Foundation//D...
2018-08-15 09:43:00 93
转载 struts2 操作web资源原理
B\S 的应用的 Controller 中必然需要访问 WEB 资源: 向域对象中读写属性, 读写 Cookie, 获取 realPath …. 结构: I. 和 Servlet API 解耦的方式: I.1 TestActionContextAction.java:...
2018-08-07 14:23:00 107
转载 struts2 基本配置
响应请求最基本的实现。相比实现Filter 来说,使用 struts.xml 文件可以实现更多功能,可以响应web 请求。 struts自带的拦截器也能识别出是哪个servletpath,然后调用struts.xml配置文件配置的action,进而利用返回的result 来进行下一步操作。 ...
2018-07-31 13:55:00 131
转载 Activiti 入门
此处参考过几篇网友写的博客,然后自己测试之后做出来的总结。如有雷同,纯属抄袭他们: 一个简单的例子,工作流的作用不再赘述,直接上。 开发工具为 Idea,安装 Activiti 插件: 新建的 maven 项目,项目结构: 因为是开发工具的问题,新建的 bpmn 文件需要...
2018-07-19 10:56:00 111
转载 使用Filter作为控制器的web项目
使用filter 作为控制器处理请求 (Struts2就是使用 Filter 作为入口。SpringMVC 使用的是Servlet) 项目结构: FilterDispatcher: package com.cwh.struts2.helloworld;import java...
2018-07-17 15:24:00 183
转载 Spring+Struts2
知识点参考上一篇博客,此处主要说整合 Struts2 的点: 1). 整合目标 ? 使 IOC 容器来管理 Struts2 的 Action! 2). 如何进行整合 ? ①. 正常加入 Struts2 (配置struts.xml文件) ②. 在 Spring 的 IOC 容器中配置 S...
2018-07-11 10:39:00 145
转载 spring+web
1.spring 在web中的应用: 创建dynamic web项目 创建SpringServletContextListener监听器(需实现ServletContextListener) 创建TestServlet(需继承HttpServlet) 1).需要加入额外的jar 包...
2018-07-03 20:46:00 111
转载 spring+hibernate
spring为主,持久层使用hibernateSpring hibernate 事务的流程1. 在方法开始之前①. 获取 Session②. 把 Session 和当前线程绑定, 这样就可以在 Dao 中使用 SessionFactory 的getCurrentSession() ...
2018-07-02 18:09:00 76
转载 spring-基于注解和配置文件配置事务-2
2.完全基于配置文件开启事务项目结构:ServiceImpl:package com.cwh.spring.transaction.xml.service.impl;import org.springframework.transaction.annotation.Isolatio...
2018-06-28 10:30:00 139
转载 spring-基于注解和配置文件配置事务-1
1.基于注解配置事务 1.1 事务的传播行为 1.2 事务隔离级别 1.3 事务的只读 1.4 事务过期 基于注解使用事务: package com.cwh.spring.transaction;import org.springframework.beans.fa...
2018-06-27 14:40:00 150
转载 spring-JdbcTemplate
Spring JDBC模板,1:用具名参数的NamedParameterJdbcTemplate 2:非具名参数的JdbcTemplate db.properties: user=rootpassword=zengdri...
2018-06-21 17:40:00 80
转载 spring-AOP(基于配置文件方式实现)
不再使用注解,所有的类都是普通类切面类:package com.cwh.spring.aop.xml;import java.util.Arrays;import java.util.List;import javax.naming.spi.DirStateFactory.Res...
2018-06-20 11:57:00 89
转载 spring-AOP(基于注解方式实现)
预备知识:Aspectj切入点语法定义在使用spring框架配置AOP的时候,不管是通过XML配置文件还是注解的方式都需要定义pointcut”切入点”切入点表达式 execution(* com.cwh.spring.aop.impl..(..))"execution()是最常用的切...
2018-06-15 16:02:00 80
转载 spring生命周期
applicationContext.xml。只要有bean放入容器中,构造方法就会被调用,后置处理器的方法也会随着被调用。无论实体类是否有init-method,后置处理器的方法都会在构造方法之后执行的<?xml version="1.0" encoding="UTF-8"?>...
2018-06-15 15:12:00 76
转载 spring 配置bean工厂的三种方式
beans-factory.xml<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www...
2018-06-11 14:02:00 113
转载 spring读取外部文件+SpEL
bean-properties.xml: <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="h...
2018-06-08 09:53:00 188
转载 spring 环境搭建+IOC
环境搭建:eclipse 4.6.0版本, 安装对应版本的插件springsource-tool-suite-3.8.1.RELEASE-e4.6-updatesite.zipjar包:测试类:package com.cwh.spring.beans;import org.spring...
2018-06-06 16:27:00 71
转载 hibernate检索的几种方式
package com.cwh.hibernate.enties.hql;import static org.junit.Assert.*;import java.util.List;import org.junit.Test;import static org.junit.A...
2018-05-18 15:13:00 74
转载 hibernate类与映射文件
constrained:one-to-one的单向关联中,如果constrained=false,则会在查询时就全部取出来,用left outer join的方式。如果constrained=true,hibernate即会延迟加载sql,只把主表的查出来,等有用到关联表的再发sql取。 a...
2018-05-03 11:20:00 96
转载 hibernate基础
此处用的是eclipse,已安装hibernate插件package com.cwh.hibernate.entity;import static org.junit.Assert.*;import java.util.Date;import java.util.List;impo...
2018-04-19 12:43:00 89
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人