*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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.
 
 
subject: A doubt about contexts
 
Similar Threads
pathing - what is the reasoning behind this ?
mapping value in html page
Using a different context directory than the default webapps in Tomcat 5
<jsp:useBean>
how to add checkbox html tag?- urgent!