Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Difference between session userData and adfcontext sessionScope

ILya CycloneJun 29 2015 — edited Jul 3 2015

Hello.

I have a requirement of putting some variables into user web session when he logs into ADF application.

I don't use custom login method, so I'm writing the code in application module prepareSession method.

And here I see two methods to do that:

MyAppModuleImpl {

    @Override

    protected void prepareSession(Session session) {

     ...

     session.getUserData().put("varName", varValue);

     ADFContext.getCurrent().getSessionScope().put("varName", varValue);

    }

}

Later I need to use the variable in ViewObject bind variable value (groovy) and in managed bean (java).

1. Which one of those two ways is correct/preferred? What is the difference between them?

2. Can I access both in vo groovy and managed bean method?

3. Are both of them passivation/activation safe?

Thank you.

ADF 12c

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 31 2015
Added on Jun 29 2015
7 comments
1,593 views