• Post Reply Bookmark Topic Watch Topic
  • New Topic

Attribute In Page Scope Doubt !!!  RSS feed

 
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..
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!