2017-10-19 18:40
@JFinal 假如我去掉了这个函数 直接用
http://localhost:8080/index/index 能很好的验证登录。
但假如客户打错了 ,打成了带,
html后缀的http://localhost:8080/index/index。html
这时候错误更多了
2017-10-19 17:12
我的是没通过render的,
response.setCharacterEncoding("UTF-8");
System.out.println(target);
if (target.endsWith(".html")) {
try {
Map map = new HashMap();
Enumeration pNames = request.getAttributeNames();
while (pNames.hasMoreElements()) {
String name = (String) pNames.nextElement();
Object value = request.getAttribute(name);
//System.out.println(name + " " + value);
map.put(name, value);
}
RenderManager.me().getEngine().getTemplate(target).render(map, response.getWriter());
} catch (IOException e) {
e.printStackTrace();
}
isHandled[0] = true;
} else {
next.handle(target, request, response, isHandled);
}
}
2017-10-18 15:51
@JFinal
String filename = getPara("filename", "");
String filepath = getPara("filepath", "");
filepath = PathKit.getWebRootPath() + filepath;
String newPath = PathKit.getWebRootPath() + "/upload/" + filename;
renderFile(filepath, newPath);