
spring
四十岁开始写程序
写了十几年程序,年近四十忽然想真正写点程序,算是浪子回头吧
展开
-
Spring学习笔记二(2006.1.4)
Spring学习笔记二(2006.1.4)1,配置文件的配置头 - Application context definition for JPetStores business layer. - Contains bean references to the transaction manager and to the DAOs in - dataAccessContext-local/j原创 2006-01-05 12:00:00 · 1611 阅读 · 0 评论 -
Spring学习笔记 五 整合hibernate持久层 ----1,基本配置
在学习这一部分的时候我作了一个用StrutsAction访问UserDAO中方法,此方法使用了hibernateTemplate。调试过程中问题多多,好在一个一个解决了。JPetStore2.0已经有ibatis做为OR层了,我要换成hibernate需要修改Spring配置文件中的bean id="TransactionManager" 、增加bean id=“sessionFactory”。又原创 2006-01-11 15:03:00 · 1659 阅读 · 0 评论 -
Spring读书笔记(四)与Struts整合
《Spring开发指南》只写了一种与struts整合的方法,另一种到Spring2.0 Demo自带的Doc中查找到Action直接继承ActionSupport。详细信息:To integrate your Struts application with Spring, you have two options:Configure Spring to manage your Actions as原创 2006-01-10 16:42:00 · 2007 阅读 · 0 评论 -
Spring学习笔记三 Spring异常处理 060109
配置Spring异常处理之需要增加一个bean的配置: 增加了一个异常处理的bean /exception/failure /exception/showDBError /exception/showError 这样就可以统一分别处理不同Exception了。注意jsp页面在request中attribute等于“exception”,而不原创 2006-01-09 14:59:00 · 4315 阅读 · 0 评论 -
Spring学习笔记 (六) 在Spring中使用AOP例子
实践了《指南》中的例子165页到169页,最后补充一个Action,public class AOPMethodCostTimeAction extends ActionSupport { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpSe原创 2006-01-12 15:30:00 · 2187 阅读 · 0 评论 -
Spring 学习笔记(五)整合Hibernate---- 3 问题和解决 补充2
现象:UserAction中修改://UserDAO dao = (UserDAO) wac.getBean("userDAO");UserDAO dao = (UserDAO) wac.getBean("userDAOProxy"); //@1配置文件中增加: PROPAGATION_REQUIRED PROPAGATION_REQUIRED,readOn原创 2006-01-11 16:34:00 · 1381 阅读 · 0 评论 -
Spring AOP [转贴]
AOP正在成为软件开发的下一个圣杯。使用AOP,你可以将处理aspect的代码注入主程序,通常主程序的主要目的并不在于处理这些aspect。AOP可以防止代码混乱。 为了理解AOP如何做到这点,考虑一下记日志的工作。日志本身不太可能是你开发的主程序的主要任务。如果能将“不可见的”、通用的日志代码注入主程序中,那该多好啊。AOP可以帮助你做到。 Spring framework是很有前途的AOP技术转载 2006-01-12 20:16:00 · 1080 阅读 · 0 评论 -
Spring学习笔记(五)使用Hibernate持久层 --- 2 问题与解决总结
现象1:org.springframework.beans.factory.BeanCreationException: Error creating bean with name org.springframework.aop.support.DefaultPointcutAdvisor defined in null: Cant resolve reference to bean tx原创 2006-01-11 15:38:00 · 8173 阅读 · 0 评论 -
Spring jPetStore err:org.apache.jasper.JasperException: /WEB-INF/jsp/struts/IncludeTop.jsp(23,0) According to TLD or attribute d
Sping Demo JpetStore 当web.xml配置和struts整合时,运行jsp页面会出现如下错误:org.apache.jasper.JasperException: /WEB-INF/jsp/struts/IncludeTop.jsp(23,0) According to TLD or attribute directive in tag file, attribute test原创 2006-01-10 14:53:00 · 7523 阅读 · 0 评论 -
Spring SimpleFormController err: Neither Errors instance nor plain target object for bean name 'command' available as request at
使用SimpleFormContrller , Validator , 还有简单的register.jsp with to show error message.也会出现一些错误,翻译为“页面上中的command和定义的不一样”。javax.servlet.jsp.JspTagException: Neither Errors instance nor plain target object f原创 2006-01-06 20:17:00 · 3661 阅读 · 0 评论 -
Spring Err ModelAndView [ModelAndView: materialized View is [null]; model is {kao=org.springframework.samples.jpetstore.web.srx.
SimpleFormController , Validator, 简单的register.jsp上有简单的 tag .出错如下:javax.servlet.ServletException: ModelAndView [ModelAndView: materialized View is [null]; model is {command=org.springframework.samples.原创 2006-01-06 20:05:00 · 5289 阅读 · 0 评论 -
Spring学习笔记一(2005.12.30)
ApplicationContext ctx 1,定义资源文件获得资源文件的消息,国际化信息 xxxx 将会搜索xxxx.properties,xxxx_zh.properties ,xxxx_ch.properties等。2,程序里使用资源文件 :ctx.getMessage(key,arg);页面上使用资源文件:3,使用其他文件。 Resource rs = ctx.getResour原创 2006-01-05 12:01:00 · 2935 阅读 · 0 评论 -
难以想象Spring中文论坛05年关于AOP的帖子不到一页
本想找些SpringAOP的资料,但是Spring中文论坛05年关于AOP的帖子不到一页,虽然我没看是深入研究AOP,但从直觉判断当前项目中使用Spring AOP是少之又少。可能是性能的原因,也可能是其他原因。当然,英文资料还是不少的。顺便通过切身体会总结一下资料的使用:1,参考手册不适合初学者想通过参考手册来学习任何东西都是错误的,使用参考手册的方法是:第一次接触的时候翻翻目录,了解一下此框架原创 2006-01-13 10:03:00 · 1968 阅读 · 0 评论