Announcement Announcement Module
No announcement yet.
Using HttpSession in Controller - Best Practice? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using HttpSession in Controller - Best Practice?

    I believe I posted this inappropriately in Web.
    I am new to Spring.

    I have been told in the past to avoid setting attributes in the session of our web application unless it is user information that would be needed for the length of the session.

    I see Session beinused throughout Controllers.
    Is this a Best Practice? Are there examples where this is not used?
    Can someone please share the Pros and Cons?



  • #2
    Are you basically asking what you should or shouldn't put i the session?


    • #3
      Sorry not to have been clear...

      I was given a demo on using the Spring Framework.

      It consisted of a screen that listed elements, the ability search., then add/update.

      It included the use of a filter being stored in the session, in order to know what was being submitted for the search. The request to the formBackingObject was used to get the session, and get a filter if it had been used before.

      I am not used to using session in this manner, and wanted to know if this is a best practice. Generally, I would get the inputs from the request.

      I am hoping to learn Best Practices from the get-go.