摘要: 网上搜了一下有几种答案,但没有试过1.spring中的httpsession改为context中的session,就可以获得HttpSession session = ServletActionContext. getRequest().getSession();2.velocity配置中加入 ,将exposeSessionAttribute参数设为true3.在 tools.xml 里面加上: 阅读全文
posted @ 2013-09-13 10:58 y.lucia 阅读(2640) 评论(0) 推荐(0) 编辑
摘要: 今天在项目中用到了ehcache缓存,将list缓存到ehcache中,但是又存在分页问题,会传入Page类,默认的key命名方式失效,网上资料比较少,总结代码贴上来。spring整合ehcache的配置主要参考http://blog.goyello.com/2010/07/29/quick-start-with-ehcache-annotations-for-spring/,已经非常详细了,不累赘叙述。在上篇资料的基础上,假设controller里面有个这样的方法:public List queryActivities(Page page, long clubId) { Listres... 阅读全文
posted @ 2013-09-12 16:23 y.lucia 阅读(3948) 评论(0) 推荐(0) 编辑
摘要: aa 阅读全文
posted @ 2013-07-09 19:00 y.lucia 阅读(670) 评论(1) 推荐(0) 编辑
摘要: 线程的实现方法有两种:1 实现runnable接口中的run方法class test implements Runnable{ public void run(){ //实现代码 }}使用时: Runnable r = new test(); Thread t = new Thread(r); t.start();2 构建Thread子类class test extends Thread{ public void run(){ //实现代码 }}直接new test().start()注意调用的的start方法,调用run方法只... 阅读全文
posted @ 2013-05-31 23:59 y.lucia 阅读(217) 评论(1) 推荐(0) 编辑