2019-02-19 12:48

@JFinal 升级了没用

2019-01-24 07:57

config 可以设置handler:me.add(new ContextPathHandler("ctx"));
#(ctx)/js/jquery-1.4.4.min.js

2018-12-25 18:53

https://www.jfinal.com/doc/4-3

2018-12-04 12:59

@欲风217 现在用上了 jfinal-undertow 1.1了 已经解决了

2018-11-22 15:52

2018-11-12 20:12

和正常sql一样调用就行

2018-11-05 08:51

刷新

2018-10-18 16:06

public class ParaInDirective extends Directive {


/**
* 描述:
*/
private int index = -1;

/**
* 描述:
*
* @param exprList
* @author
* @created 2017年7月7日 下午2:57:23
* @see Directive#setExprList(ExprList)
*/
public void setExprList(ExprList exprList) {
if (exprList.length() == 1) {
Expr expr = exprList.getExpr(0);
if (expr instanceof Const && ((Const) expr).isInt()) {
index = ((Const) expr).getInt();
if (index < 0) {
throw new ParseException("The index of para array must greater than -1", location);
}
}
}
this.exprList = exprList;
}

@Override
public void exec(Env env, Scope scope, com.jfinal.template.io.Writer writer) {
SqlPara sqlPara = (SqlPara) scope.get("_SQL_PARA_");
if (sqlPara == null) {
throw new TemplateException("#paraIn invoked by getSqlPara(...) method only", location);
}
StringBuffer inPlaceholder = new StringBuffer();
String valueStr = "";
if (index == -1) {
Expr[] exprArray = exprList.getExprArray();
Object ret = null;
for (Expr expr : exprArray) {
boolean hasPara = scope.getData().containsKey(expr.toString());
if (hasPara) {
ret = expr.eval(scope);
if (ret == null) {//in类的参数值不可为空
throw new TemplateException(
"The value of parameter '" + expr.toString() + "' must not be null",
location);
}
} else {//没有传参数抛异常
throw new TemplateException(
"The parameter '" + expr.toString() + "' must be define",
location);
}
}
valueStr = String.valueOf(ret);
// sqlPara.addPara(exprList.eval(scope));
} else {
Object[] paras = (Object[]) scope.get("_PARA_ARRAY_");
if (paras == null) {
throw new TemplateException(
"The #paraIn(" + index + ") directive must invoked by getSqlPara(String, Object...) method",
location);
}
if (index >= paras.length) {
throw new TemplateException("The index of #paraIn directive is out of bounds: " + index, location);
}
valueStr = String.valueOf(paras[index]);
// sqlPara.addPara(paras[index]);
}
Object[] retArrray = valueStr.split(",");
for (int i = 0; i < retArrray.length; i++) {
inPlaceholder.append("?");
if (i != retArrray.length - 1) {
inPlaceholder.append(",");
}
sqlPara.addPara(retArrray[i]);
}
write(writer, inPlaceholder.toString());
}

}

2018-08-25 12:50

没有安全问题吗?

2018-08-09 09:39

@Don小浩 百度搜索 KickoutSessionControlFilter