LinkedNestBlog

HttpServletRequest의 setAttribute

by 이진원Dev
HttpServletRequest의 setAttribute


Ref.] http://blog.whitelife.co.kr/214

Why : MVC 패턴 과정에서 파라미터를 추가해 필터 후처리에서 사용할 필요성이 생김.
How :
  - setAttribute
   HttpServletRequest httpRequest = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest(); 
   httpRequest.setAttribute(parameter name, parameter value);
-getAttribute
request.getAttribute(parameter name);