Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

What can I do with the pageContext EL implicit object

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.

I have just met the EL implicit object named "pageContext". Unlike all the other EL implicit objects, it is a bean, not a map, and an instance of a PageContext object so it would seem.

I am trying to find something useful I can do with it in EL, but I can find nothing. Yes, I can output it's full name with ${pageContext}. But that's not much fun.

And, yes, as a bean it has a whole bunch of getXxx methods. But none of those return a string, map, list or bean that I can play with in EL.

So, I wonder to myself, what useful use is there for this EL implicit object? Does anyone have an example? Is it coming up in a later chapter perhaps?

John
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

But none of those return a string, map, list or bean that I can play with in EL.


For example, ${pageContext.request.locale.language}. Look at the API and find the getters. You're saying that none of the getters returns a bean (what are you calling a bean ?), but they all return something, don't they ? getRequest() returns a ServletRequest. From there, you look at the the getters in ServletRequest, so that you can figure out what you can use.
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

As you know, this api was designed to give you access to other objects that aren�t directly acessible by the other implicit objects(maps) of the EL like request, response and others. Often I use this api to access some properties of the request, like server address, contextPath, local address and so... If you research this apis you can find a lot of useful methods...
 
And then we all jump out and yell "surprise! we got you this tiny ad!"
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic