摘要: @Component:标注一个普通的Spring Bean类。@Controller:标注控制器组件类。@Service:标注业务逻辑组件类。@Repository:标注DAO组件类。@Scope:指定Bean的作用域。@Resource:配置依赖。@PostConstruct和@PreDestro... 阅读全文
posted @ 2014-05-15 15:18 harryV 阅读(390) 评论(0) 推荐(0) 编辑
摘要: singleton:单体模式,在整个Spring IoC容器中只有一个实例。prototype:原型模式,每次通过容器的getBean获取的bean都会产生一个新的实例。request:对于每次HTTP的请求,使用request定义的bean都会产生一个新的实例。session:对于每次HTTP S... 阅读全文
posted @ 2014-05-15 10:06 harryV 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 1:设值注入 spring容器使用属性的setter方法来注入被依赖的实例(使用最多) Person接口package com.lee.bean;public interface Person { public void eat();} Fruit接口package com.lee.be... 阅读全文
posted @ 2014-05-14 16:25 harryV 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 1:struts2-spring-pluginSpring整合Struts2所必须的jar包2:org.springframework.expression.PropertyAccessor缺少org.springframework.expression jar包3:web工程导入jar包不能用 b... 阅读全文
posted @ 2014-05-14 11:04 harryV 阅读(189) 评论(0) 推荐(0) 编辑
摘要: /** * Created with IntelliJ IDEA. * User: li_zhe * Date: 14/05/06 * Time: 12:34 * To change this template use File | Settings | File Templates. */pack... 阅读全文
posted @ 2014-05-13 11:15 harryV 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 使用stream类型的result实现ajaxpackage com.lee.action;import java.io.ByteArrayInputStream;import java.io.InputStream;import com.opensymphony.xwork2.ActionSupp... 阅读全文
posted @ 2014-05-04 09:35 harryV 阅读(223) 评论(0) 推荐(0) 编辑
摘要: struts.xml /login.jsp /welcome.jsp /error.jsp /regist.jsp ... 阅读全文
posted @ 2014-04-28 13:56 harryV 阅读(170) 评论(0) 推荐(0) 编辑
摘要: web.xml文件 Struts2_Test struts2 org.apache.struts2.dispatcher.FilterDispatcher struts2 /* struts.xml文件 ... 阅读全文
posted @ 2014-04-25 14:25 harryV 阅读(206) 评论(0) 推荐(0) 编辑
摘要: Servlet规范中所引入的filter令人心动不已,因为它引入了一个功能强大的拦截模式。Filter是这样一种Java对象,它能在request到达servlet的服务方法之前拦截HttpServletRequest对象,而在服务方法转移控制后又能拦截HttpServletResponse对象。你... 阅读全文
posted @ 2014-04-22 09:56 harryV 阅读(16117) 评论(0) 推荐(2) 编辑
摘要: ServletContextListener:监听web的启动和关闭。package com.li.test;import java.sql.Connection;import java.sql.DriverManager;import java.sql.SQLException;import ja... 阅读全文
posted @ 2014-04-21 11:21 harryV 阅读(185) 评论(0) 推荐(0) 编辑