Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getJspContext().setAttribute problem.

 
geet kaur
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was just going through the doTag() method Where we set the attribute as in getJspContext().setAttribute("movie",some value).I just wanted to know what would be the scope of the movie attribute??


I mean is it related to the tag only or can we use it somwhere else in jsp as well??
 
Piyush Joshi
Ranch Hand
Posts: 207
Eclipse IDE Firefox Browser jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It will have PageContext.PAGE_SCOPE
There is an overloaded method setAttribute(String name,Object value,int scope) which sets the given attribute in given scope.
 
geet kaur
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so it means..we can use this attribute outside the tag as well right??
 
Piyush Joshi
Ranch Hand
Posts: 207
Eclipse IDE Firefox Browser jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes right.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic