上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 24 下一页
摘要: ClassPathResource 在类路径下读取资源public final String getPath()public boolean exists()public InputStream getInputStream()WebUtils 获取web资源工具类public static String getRealPath(ServletContext servletContext, String path)public static Object getSessionAttribute(HttpServletRequest request, String name)public sta 阅读全文
posted @ 2014-02-14 11:15 大新博客 阅读(1887) 评论(0) 推荐(0)
摘要: 1. 下载freemarker-ide :http://sourceforge.net/projects/freemarker-ide/files/2. 下载完成后解压,由于IDE中的freemarker版本比较老,需要将自己BuildPath中的freemarker的jar包替换下载的freemarker-2.3.6.jar。3. 修改hudson.freemarker_ide_0.9.14/META-INF/MANIFEST.MF文件4. 将hudson.freemarker_ide_0.9.14文件夹放入MyEclipse安装目录dropins下(例:D:\Program Files\M 阅读全文
posted @ 2014-02-12 10:03 大新博客 阅读(585) 评论(0) 推荐(0)
摘要: Mybatis MapperScannerConfigurer 自动扫描 将Mapper接口生成代理注入到SpringMybatis在与Spring集成的时候可以配置MapperFactoryBean来生成Mapper接口的代理. 例如 MapperFactoryBean 创建的代理类实现了 UserMapper 接口,并且注入到应用程序中。 因为代理创建在运行时环境中(Runtime,译者注) ,那么指定的映射器必须是一个接口,而 不是一个具体的实现类。上面的配置有一个很大的缺点,就是系统有很多的配置文件时 全部需要手动编写,所以上述的方式已经很用了。没有必要在 Spring 的 XM... 阅读全文
posted @ 2014-02-11 21:08 大新博客 阅读(95056) 评论(3) 推荐(7)
摘要: Mybatis SqlSessionTemplate 源码解析在使用Mybatis与Spring集成的时候我们用到了SqlSessionTemplate 这个类。 通过源码我们何以看到SqlSessionTemplate 实现了SqlSession接口,也就是说我们可以使用SqlSessionTemplate 来代理以往的DefailtSqlSession完成对数据库的操作,但是DefailtSqlSession这个类不是线程安全的,所以这个类不可以被设置成单例模式的。如果是常规开发模式 我们每次在使用DefailtSqlSession的时候都从SqlSess... 阅读全文
posted @ 2014-02-11 13:00 大新博客 阅读(49220) 评论(3) 推荐(11)
摘要: Mybatis Interceptor 拦截器原理 源码分析Mybatis采用责任链模式,通过动态代理组织多个拦截器(插件),通过这些拦截器可以改变Mybatis的默认行为(诸如SQL重写之类的),由于插件会深入到Mybatis的核心,因此在编写自己的插件前最好了解下它的原理,以便写出安全高效的插件。代理链的生成Mybatis支持对Executor、StatementHandler、PameterHandler和ResultSetHandler进行拦截,也就是说会对这4种对象进行代理。通过查看Configuration类的源代码我们可以看到,每次都对目标对象进行代理链的生成。 public . 阅读全文
posted @ 2014-02-09 21:14 大新博客 阅读(17885) 评论(0) 推荐(3)
摘要: 我们以往使用ibatis或者mybatis 都是以这种方式调用XML当中定义的CRUD标签来执行SQL 比如这样 SqlSession session = sqlSessionFactory.openSession();try { Blog blog = (Blog) session.selectOne("org.mybatis.example.BlogMapper.selectBlog", 101);} finally { session.close();}这种方式有很明显的缺点就是通过字符串去调用标签定义的SQL,第一容易出错,第二是当XML当中的id修改过以后你不知道 阅读全文
posted @ 2014-02-08 16:00 大新博客 阅读(5185) 评论(0) 推荐(0)
摘要: configuration\org.eclipse.core.runtime\.keyring 删除MyEclipse下面的文件。或者修改服务器端的用户密码。 阅读全文
posted @ 2014-02-08 14:14 大新博客 阅读(209) 评论(0) 推荐(0)
摘要: http://docs.spring.io/spring/docs/3.0.x/spring-framework-reference/html/transaction.html#transaction-declarative-annotations官方文档上有说明 阅读全文
posted @ 2014-02-06 12:19 大新博客 阅读(1006) 评论(0) 推荐(0)
摘要: ProcessDefinitionEntity d = (ProcessDefinitionEntity)((RepositoryServiceImpl)repositoryService).getDeployedProcessDefinition("FirstActiviti:1:104"); 32急配置邮件服务器 阅读全文
posted @ 2014-02-02 16:21 大新博客 阅读(289) 评论(0) 推荐(0)
摘要: ArrayBlockingQueue实现,有容量限制的阻塞队列,实现原理如下class BoundedBuffer { final Lock lock = new ReentrantLock(); final Condition notFull = lock.newCondition(); final Condition notEmpty = lock.newCondition(); final Object[] items = new Object[100]; int putptr, takeptr, count; public void put(Object ... 阅读全文
posted @ 2014-01-28 14:05 大新博客 阅读(353) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 24 下一页