jFinal的小知识点总结

sql批处理

 // 批处理sql
List sqlList = new ArrayList();
sqlList.add("delete from nice where note = '111'");
sqlList.add("delete from nice where note = '222'");
sqlList.add("delete from nice where note = '333'");
Db.batch(sqlList, 3);

 Action获取路径

// 获取项目路径{例如:nice}
String projectPath = getRequest().getContextPath();
// 获取方法名路径{例如:action/searchMethod}
String methodPath = getRequest().getServletPath();
// 获取服务器的绝对路径{例如:D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nice\}
String realPath = getRequest().getRealPath("");

你可能感兴趣的:(jFinal的小知识点总结)