• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

scoping difference

 
Ranch Hand
Posts: 401
Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

May i know what are the difference among the scopes we set in the different places.

Say, my variable name called String name; is in the the form bean which, of course, has session scope.
differnt senariaos,what will happen
in my struts-config if i mention scope= request.
in my action class if i set the value of the name to session.
and in my jsp if i use some other scope.

may i know the actual process to be followed and priority is given to different files for the same scope variables.


rahul.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This link contains an article that explains J2EE scopes pretty well. If you have the same variable name in different scopes and don't specify a scope in say, a bean:write tag, my understanding is that it will use the narrowest scope. For example, if you have the variable "foo" in both request and session scope, it will pick up the one in request scope first.
 
reply
    Bookmark Topic Watch Topic
  • New Topic