Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Query regd c:set and Page Scope

 
Amit K Singh
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Please help me in following queries.

1)
<c:set var="pqr" .... >
<c:set target="${pqr} .... >

Why in var "" are used and in target ${} is used.
Please help.

2)
As per JSP spec target cannot be an "id" of an attribute.
what does it mean. can any one explain with small example.


3) Page Scope. Does it also include all variables declared using
scriplet in JSP. If no then please help me understand significance of Page Scope. ( Page Scope is killing me ... need some help ....)
 
cheenu Dev
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in c:set(in all jstl tags too) var cannot have dynamic expressions.
same is for 'scope'.
so you cant have say var='${variable}'

for c:set target, target must point to a real thing.not an attribute.
so you have target = '${...}'

"References to objects with page scope are stored in the pageContext
object." thats what the spec says in pg no:1-39(JSP)
as for as scriptlets are concerned they are variables in corresponding servlet generated by the container.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic