Results 1 to 2 of 2

Thread: Spring Controller behaviour

  1. #1

    Question Spring Controller behaviour

    Hi,

    If I store an object within a controller as its private member, for example i have a hibernate entity called Contact and I store List<Contact> contacts as a Controller's private member and the Controller's scope is prototype. Will the user get the same Contact everytime he refreshed ? or is it possible for a user met another Controller which has other user's Contact ?

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    You shouldn't keep state inside your Controller. Your Controller should be stateless.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •