Request 에서 Parameter 정보 추출
protected HashMap<String, Object> getRequestParam() {
ServletRequestAttributes sra = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();
HttpServletRequest request = sra.getRequest();
HashMap<String, Object> params = new HashMap<>();
Enumeration paramNames = request.getParameterNames();
while(paramNames.hasMoreElements()) {
String paramNames = pramNames.nextElement().toString();
params.put(paramName, request.getParameter(paramName));
}
return params;
}
댓글
댓글 쓰기