在此代码中,我使用ActionContext从Request对象获取Session和ServletActionContext。我觉得这是不好的做法,因为只有Action对象只能用于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);
use request.getParameter(“parameter_name”); –