How to change session scope properties using ognl?

前端 未结 1 1707
滥情空心
滥情空心 2020-12-12 05:34

Is it possible to change session scope properties using ognl?

For example, if I have on my session an attribute called PROCESS_CONFIG whic

相关标签:
1条回答
  • 2020-12-12 05:52

    The session in S2 is a map where you could put the attributes before you use it with OGNL in the JSP. To have this working around let your action implement the SessionAware and look at the official site for the description and usages, and read How do we access to the session from the FAQ.

    To your question: why didn't you get the attribute in JSP. Because you are using S2 and OGNL to get it (via #session reference) and you didn't put the attribute to S2 session. S2 session implementation differs from the standard http session. However, if you set attribute to the standard http session you can still access it in JSP 2.0 manner. The opposite is also true.

    0 讨论(0)
提交回复
热议问题