#spring #设置Tag是个好习惯 大概有两种方式:从ApplicationContext上下文容器获取和从BeanFactory bean工厂中获取1.ApplicationContext ac=new ClassPathXmlApplicationContext("applicationContext.xml"...
#spring #aop #设置Tag是个好习惯 “AOP”的意思就是面向切面编程,所谓切面个人觉得就是将某段代码在运行的时候插入到运行的对象里,并且执行。之前在Jfinal框架中有涉及过,但是Jfinal中的切面编程不需要xml配置,相比spring框架简单太多了。spring的AOP有5种类型:前置通知(before),后置通知(after)...
#Hibernate #java #设置Tag是个好习惯 openSession()和getCurrentSession()的区别:1.openSession() 是获取一个新的session2.getCurrentSession() 获取的是当前线程绑定的session,换言之获取到的是同一个session,有利于事务控制。要用getCurrentSe...
#Hibernate #设置Tag是个好习惯 今天用工具生成数据库映射文件,然后用application的main函数调试的时候报了javax.naming.NoInitialContextException异常:异常具体内容是:Need to specify class name in environment or system prope...