This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Joe Ess

c:set scope option  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

In page 447 of Head First Servlets and JSP, the authors have mentioned that default scope for <c:set> is page scope. Further, in the section "there are no dumb questions" , the authors have mentioned in the second answer that if you do not use scope in the tag, the container will search scope in the following order - page, request, session and then application/context. Only after not finding an attibute in any of the four scopes, the container will create a new attribute in the page(default) scope.

Ok, after that in a thread I looked up to clear my understanding(, Kathy has said that the container will look ONLY in the page scope. If it does not find an attribute, in the page scope only, then it will create a new attribute.

So, if i have
request.setAttribute("name", "abc")

and use
<c:set var="name" value="def"/>

and use

Assuming, these are the only attributes,Will I get null(the container searched through all the scopes) or "def" (the container looks in page scope only and creates a new attribute in page scope finding no attribute matching name in page scope).

I am a little confused. Where am I going wrong?

Thanks in advance.
[ January 02, 2006: Message edited by: Nachiketas ]
lowercase baba
Posts: 12627
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Perhaps you missed our naming policy on the way in. Basically, it requires a real sounding first AND last name.

Please go here and update your display name.

Thanks, and we'll see you 'round the ranch!!!
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!