This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JSP and the fly likes A doubt about contexts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "A doubt about contexts" Watch "A doubt about contexts" New topic
Author

A doubt about contexts

Rafael Mattos
Greenhorn

Joined: Apr 23, 2012
Posts: 2
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

Joined: Jan 22, 2007
Posts: 196
How about trying printing the same yourself and let us know the result?
Rafael Mattos
Greenhorn

Joined: Apr 23, 2012
Posts: 2
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

Joined: Jan 22, 2007
Posts: 196
The precedence order is as follow -> pageScope, requestScope, SessionScope and then applicationScope.
 
GeeCON Prague 2014
 
subject: A doubt about contexts