Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

"c:set target" but no scope?

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it true that when using "c:set target" there is no scope attribute?
if i have
<%
request.setAttribute("mymap", new java.util.HashMap());
page.setAttribute("mymap", new java.util.HashMap());
%>
<c:set target="${mymap}" property="surname" value="145"/>
this always sets the mymap in page Scope
if i try
<c:set target="${mymap}" property="surname" value="145" scope="request"/>
i allways getting an error:
Illegal scope attribute without var in "c:set" tag.
how can i differentiate the scopes when using "c:set target" ?
[ September 29, 2005: Message edited by: Ner min ]
 
Ner min
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
he he, i got it. it is simple:
<c:set target="${requestScope.mymap}" property="surname" value="145"/>
 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes,
always target should evaluate to OBJECT. It is not id of a attribute or bean. It should always evaluate to either java bean or hashmap. SO target should always have some script expression or EL.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic