Tag Archives: jsp session access

[Struts2] Jsp 페이지에서 session 변수에 접근

Struts2: Accessing Session Variables in JSP’s
참조: http://j2eewebprogrammer.blogspot.com/2009/06/struts2-accessing-session-variables-in.html

Struts 2 places named objects including the session onto the OGNL stack.
Struts2는 session을 포함한 named objects를 OGNL 스텍에 놓는다.

Action:
 extends ActionSupport implements SessionAware

  setSession("user", user);

JSP:
<s:property value="%{#session.user.firstName}"/>
Request parameter : #parameters['attrName ']
Request attribute : #request.attrName 
Session attribute : #session.attrName
Application Attribute : #application.attrName