2017-02-06 11:29

这条完美解决了我当前代码冗余的问题:
20:Model.getConfig() 的可见性由 private 改为 protected

2017-02-06 10:47

源码中这样写到:
//2.0 这样的__________________________________________
public FileRender(File file) {
this.file = file;
}

public FileRender(String fileName) {
fileName = fileName.startsWith("/") ? webRootPath + fileName : fileDownloadPath + fileName;
this.file = new File(fileName);
}


//3.0 这样的__________________________________________
public FileRender(File file) {
if (file == null) {
throw new IllegalArgumentException("file can not be null.");
}
this.file = file;
}

public FileRender(String fileName) {
if (StrKit.isBlank(fileName)) {
throw new IllegalArgumentException("fileName can not be blank.");
}

String fullFileName;
fileName = fileName.trim();
if (fileName.startsWith("/") || fileName.startsWith("\\")) {
if (baseDownloadPath.equals("/")) {
fullFileName = fileName;
} else {
fullFileName = baseDownloadPath + fileName;
}
} else {
fullFileName = baseDownloadPath + File.separator + fileName;
}

this.file = new File(fullFileName);
}

2017-02-06 10:34

@杜福忠 ps: 不要put, 只remove就可以了, 源码中已经put了,

/**
* Find model by cache.
* @see #find(String, Object...)
* @param cacheName the cache name
* @param key the key used to get data from cache
* @return the list of Model
*/
public List findByCache(String cacheName, Object key, String sql, Object... paras) {
ICache cache = getConfig().getCache();
List result = cache.get(cacheName, key);
if (result == null) { // 这里
result = find(sql, paras);
cache.put(cacheName, key, result); // 这里
}
return result;
}

2017-02-06 10:28

remove 比 put 好一点, 比如 可以起到懒加载的作用 省点内存

2017-01-18 23:04

传送门:http://www.jfinal.com/share/73 海哥精辟详解

2017-01-13 19:11

mysql手册:

一个名为FIND_IN_SET的函数 , 就是设计用来处理这种以 逗号 分割做关系的.

如:
SELECT * FROM massage_js_pending_info
WHERE yn = 1 AND FIND_IN_SET(actionStatus, ? ) AND ...

如果你的 actionStatus 比较多
还可以使用: MATCH AGAINST

度娘一下就知道了

2017-01-04 16:25

@david wang 老大?这能 a ?

2016-12-28 09:03

http://www.kafeitu.me/activiti/2012/03/22/workflow-activiti-action.html

2016-12-24 09:43

public class BaseController extends Controller {

/**获取访问者域名*/
public String getWebSite(){
return getRequest().getServerName();
}

}
我是这样做的,不知道有什么弊端没有

2016-11-25 09:12

这个项目里面有个小工具:

http://www.jfinal.com/project/16

文件位置:
/JFinalUIBV3/platform/com/platform/tools/ToolPoi.java

2016-11-19 10:32

@spectre 您没有 close() 吧,没有close() 关闭语句,被占的文件将不能删除的

2016-11-16 19:26

@spectre 您可以贴一下代码,方便詹大分析问题在哪里