• 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

c:set using var

 
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<c:set> using var can create new request-scoped attribute. My question is that does request-scoped attribute means that the scope of the reques is request and we cannot specify other scopes for the attribute. Please correct me if i am wrong
 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An attribute can be set at any of the four levels(request,session,application or page) using <c:set>. It is not restricted to the request scope alone.

Srini
 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can use scope attribute to set the scope. default one is page scope.
 
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by N Chaurasia:
<c:set> using var can create new request-scoped attribute. My question is that does request-scoped attribute means that the scope of the reques is request and we cannot specify other scopes for the attribute. Please correct me if i am wrong



are you trying to say something like this:

<c:set var="cart" scope="request" scope="session" />

where 2 scope inside the c:set ??

i dont think this can work. It can either :

<c:set var="cart" scope="request" />
OR
<c:set var="cart" scope="session" />
OR
<c:set var="cart" scope="page" />
OR
<c:set var="cart" scope="application" />

am i correct?
 
Rizwan Mohammad
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
scope is one of the attribute of set tag.
<c:set var="id" value="100" scope="session">
is equivalent to session.setAttribute("id", "100");
if you dont give scope attribute then it is equivalent to
pageContent.setAttribute("id","100");
 
reply
    Bookmark Topic Watch Topic
  • New Topic