在此代码中,我正在使用ActionContext从Request对象获取Session和ServletActionContext。我觉得这是一种不好的做法,因为必须仅对Request对象使用ActionContext。
ActionContext的Request对象是否等效于Servlet中的Request对象?如果是,如何使用它获取请求参数?
Map session = (Map) ActionContext.getContext().getSession();
HttpServletRequest request = ServletActionContext.getRequest();
String operatorId = request.getParameter("operatorId");
session.put("OperatorId", operatorId);
// getting hashmap from Bean
analysisNames= slsLoginDetailsRemote.getAnalysisNamesIdMap();
// sending map for multiselect
session.put("AnalysisNames",analysisNames);
相关分类