• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A doubt about contexts

 
Rafael Mattos
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have small question about the contexts, or not someone corret this if I'm wrong, but here we go

Somewhere in my code a put some data in session, for example X

In have a tag file that has an attribute X, and I set on this another data that maybe not exist, lets put it here like requestScope.Y

and inside the tag file I use X direct with EL

so to illustrate, some code



if Y have neve been setted, what's gonna(should) be printed?

X: DATA or X: ?


 
Piyush Mangal
Ranch Hand
Posts: 196
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about trying printing the same yourself and let us know the result?
 
Rafael Mattos
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Piyush Mangal wrote:How about trying printing the same yourself and let us know the result?


I did it, I'm just trying to figure out, if this is right behavior or is something else

it show the data from the session...

but I think you misunderstood and thought was doing homework, but now we past that, do you know why if there is a conflict the higher context takes precedence, if that's the case

 
Piyush Mangal
Ranch Hand
Posts: 196
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The precedence order is as follow -> pageScope, requestScope, SessionScope and then applicationScope.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic