1 快速上手

2 JFinalConfig

3 Controller

4 AOP

5 ActiveRecord

6 Enjoy 模板引擎

7 EhCachePlugin

8 RedisPlugin

9 Cron4jPlugin

10 Validator

11 国际化

12 Json 转换

13 JFinal架构及扩展

14 升级到 5.1.2

7.4 EvictInterceptor

    EvictInterceptor可以根据CacheName注解自动清除缓存。以下是示例代码:

@Before(EvictInterceptor.class)
@CacheName("blogList")
public void update() {
    getModel(Blog.class).update();
    redirect("blog.html");
}

    上例中的用法将清除cacheName为blogList的缓存数据,与其配合的CacheInterceptor会自动更新cacheName为blogList的缓存数据。

     jfinal 3.6 版本支持 @CacheName 参数使用逗号分隔多个 cacheName,方便针对多个 cacheName 进行清除,例如:

@Before(EvictInterceptor.class)
@CacheName("blogList, hotBlogList")   // 逗号分隔多个 cacheName
public void update() {
   ...
}