Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix issue #159

  • Loading branch information...
commit e3d9e8c6e048884c78bc234f2de55399868e75e7 1 parent 7f953b2
@wendal wendal authored
Showing with 12 additions and 4 deletions.
  1. +12 −4 src/org/nutz/mvc/view/AbstractPathView.java
View
16 src/org/nutz/mvc/view/AbstractPathView.java
@@ -75,12 +75,21 @@ public static Context createContext(HttpServletRequest req, Object obj) {
}
// 请求对象的属性列表
- Map<String,Object> a = new HashMap<String, Object>();
+ Map<String,Object> req_attr = new HashMap<String, Object>();
for (Enumeration<String> en = req.getAttributeNames(); en.hasMoreElements();) {
String tem = en.nextElement();
- a.put(tem, req.getAttribute(tem));
+ req_attr.put(tem, req.getAttribute(tem));
}
- context.set("a", a);//TODO 是否应该用a呢? attr是不是更加好呢?
+ context.set("a", req_attr);//兼容最初的写法
+ context.set("req_attr", req_attr);
+
+ Map<String,Object> session_attr = new HashMap<String, Object>();
+ for (Enumeration<String> en = req.getSession().getAttributeNames(); en.hasMoreElements();) {
+ String tem = en.nextElement();
+ session_attr.put(tem, req.getAttribute(tem));
+ }
+ context.set("session_attr", session_attr);
+
// 请求的参数表,需要兼容之前的p.参数, Fix issue 418
Map<String,String> p = new HashMap<String, String>();
@@ -92,7 +101,6 @@ public static Context createContext(HttpServletRequest req, Object obj) {
}
context.set("p", p);
- //
Map<String, String> u = new HashMap<String, String>();
AtMap at = Mvcs.getAtMap();
if (at != null) {
Please sign in to comment.
Something went wrong with that request. Please try again.