This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes EL to check session object how? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "EL to check session object how?" Watch "EL to check session object how?" New topic
Author

EL to check session object how?

Davie Lin
Ranch Hand

Joined: Aug 05, 2007
Posts: 294
Hey everyone

If I have a User object and its store in session map like



What are the EL syntax I need to access the session object, in struts I use ${sessionScope}

Thanks
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15961
    
  19



However, it's not recommended practice to name objects using an initial capital letter.

You can also reference using an explicit scope notation, but I've never needed to do that so far. Since it's also not advisable to name scoped objects with the same name in different scopes.


Customer surveys are for companies who didn't pay proper attention to begin with.
Davie Lin
Ranch Hand

Joined: Aug 05, 2007
Posts: 294
I believe I visited the official JSF site about EL syntax from oracle.

looks like JSF can use the same implicit object like sessionScope in JSP. That should be no problem if I am using Facelets instead right?

I will remember the naming convention you mentioned

Thanks Tim
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15961
    
  19

Even in basic JSP, it was usually possible to omit the scope and have it determined implicitly. EL continues that tradition. While it may make the process of resolving objects slightly less efficient, since multiple scopes have to be searched, the payback is the flexibility of not having to change all your references if the scope needs to be changed.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EL to check session object how?
 
Similar Threads
Problem with HttpSession in Struts2
How to display retrivied users from the Datase into Drop-down menu using servlet+JSP(JSTL)
session casting problem....
Bind User to session
session casting problem....