@At
@Ok("jsp:${viewName}")
public Map<String, Object> memberSelf(HttpServletRequest request, ViewModel model){
Object user = request.getSession().getAttribute("user");
if(user != null){
model.put("viewName", "view/member-self");
String nickname = String.valueOf(user);
MemberInfo memberInfo = dao.fetch(MemberInfo.class, Cnd.where("nickname", "=", nickname));
Map<String, Object> map = new HashMap<String, Object>();
map.put("memberInfo", memberInfo);
return map;
} else {
model.put("viewName", "view/member-login");
}
return null;
}
这边做了一个根据参数判断,来返回不同页面,并将属性带上。
实际结果是:
访问/page/memberSelf这个请求
得到结果HTTP Status 404 - /wx/WEB-INF/page/memberSelf.jsp