0

Do we have concept of page scope in spring3? Suppose user open multiple tab then if data is stored in session then in some situation things may go wrong. Imagine user will open two tab in the browser. And in both these tab he is working on same page so that he can complete his work faster. So if some data is referred from session then in that case application can reach to an error state.

So to avoid this I want to store data in page scope,so that each page data will not be mixed in session? is it directly available in spring or I need to write my own conversation logic and page scope?

zapping
  • 4,118
  • 6
  • 38
  • 56
Rajesh
  • 2,934
  • 8
  • 42
  • 71
  • Try this SO. The same is being discussed http://stackoverflow.com/questions/13005421/jsf-view-scope-in-spring-3-0 – zapping Jan 03 '13 at 06:22

1 Answers1

1

In Spring you have following scope :

  • singleton - (Default) Scopes a single bean definition to a single object instance per Spring IoC container.

  • prototype - Scopes a single bean definition to any number of object instances.

  • request - Scopes a single bean definition to the lifecycle of a single HTTP request; that is, each HTTP request has its own instance of a bean created off the back of a single bean definition. Only valid in the context of a web-aware Spring ApplicationContext.

  • session - Scopes a single bean definition to the lifecycle of an HTTP Session. Only valid in the context of a web-aware Spring ApplicationContext.

  • global session - Scopes a single bean definition to the lifecycle of a global HTTP Session. Typically only valid when used in a portlet context. Only valid in the context of a web-aware Spring ApplicationContext.

Do we have concept of page scope in spring3?

--> In Spring you don't have page scope but you can configure your particular bean to use request scope.

Reference : Spring Documentation

Nandkumar Tekale
  • 16,024
  • 8
  • 58
  • 85