Wednesday, June 26, 2013

Session Values - putSessionValue vs putSessionValueDirect


  • Values set with putSessionValue function are cleared when redirected to homepage, but values set by putSessionValueDirect are cleared by logout, session invalidation and manual removal only.
  • putSessionValue can store only String, Number or Date but putSessionValueDirect can store any object.
  • Use of putSessionValueDirect is not recommended.
  • putSessionValueDirect is typically for passing information between self-service pages and non self-service pages.
  • Puts a value on the servlet session directly (through HttpSession.putValue(String name, Object value)) without associating it with a specific transaction ID.

Note: putSessionValueDirect has been used in Multple Transactions in One OAF Page.

Note: Session is not preferred place to store and pass values between pages. Refer to OAF: Passing Parameters, Encryption, Encoding.