@JFinal 詹总,请问一下,为啥find(sql, arg)这样用查询的list数据为空,sql: select * from sys_function where parent=? and del=? and id in(?) order by sort,在数据库里是查询出数据的,是不是这个find(String sql,Object... arg)方法存在bug呀
@JFinal 詹总,还想请教一个问题,比如: public class Sys_Function extends Model{ /** * */ private static final long serialVersionUID = 1L; public static final Sys_Function dao = new Sys_Function(); public Sys_Function() { tableName = "sys_function"; } private List children = new ArrayList(); public List getChildren() { return children; }
public void setChildren(List children) { this.children = children; } };
在Controller 控制器 List menu= 数据库查询出来的数据,也赋值children了 setAttr("menu", menu); 我想在jsp页面通过el获取children,${menu}可以获取值,但是${menu[0]["children"]}值却为空,要怎么解决
/**
* 获取QueryString的参数,并使用URLDecoder以UTF-8格式转码。如果请求是以post方法提交的,
* 那么将通过HttpServletRequest#getParameter获取。
*
* @param request
* web请求
* @param name
* 参数名称
* @return
*/
public static String getQueryParam(HttpServletRequest request, String name) {
if (StringUtils.isBlank(name)) {
return null;
}
if (request.getMethod().equalsIgnoreCase(POST)) {
return request.getParameter(name);
}
String s = request.getQueryString();
if (StringUtils.isBlank(s)) {
return null;
}
try {
s = URLDecoder.decode(s, UTF8);
} catch (UnsupportedEncodingException e) {
log.error("encoding " + UTF8 + " not support?", e);
}
String[] values = parseQueryString(s).get(name);
if (values != null && values.length > 0) {
return values[values.length - 1];
} else {
return null;
}
}