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

Attribute In Page Scope Doubt !!!

 
Sandeep Vaid
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q-3 How will i set an attribute in page scope and access it using EL?
Code please...
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot set attributes using EL only. You'll have to use either scriptlets or JSTL. You can read page scope attributes using either ${name} or ${pageScope.name}.
 
Sandeep Vaid
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<c:set var="name" value="sandeep" scope="page" />

${pageScope.name}
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

This is JSTL, not EL. There's no ${name=sandeep}.
 
Sandeep Vaid
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<c:set var="name" value="sandeep" scope="page" />


This is JSTL..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic