File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL equivalent of pageContext.getAttribute( aVariable )

 
Agoston Bejo
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I have a variable the value of which is a key to look up a value the way pageContext.getAttribute() does (i.e. going through the page, request, session, application scopes in a row). So the main point is that the value of the lookup key can VARY, it's not constant. (Otherwise I could say ${LookupKey} and that would be it.)

I.e. something like this:
<c:set var="theKey" value="LookupKey"/>
<c:if test="${pageContext[theKey]}"> ...

the above syntax doesn't work, of course (otherwise my question would've been automatically answered ), it's just a pseudo-code for you to get the idea.

Thanks!
Agoston
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I see what you're after... you want one level of indirection and you want all scopes to be automatically searched. I'm afraid you can't have both.

For a scoped variable whose name is within another variable, you'll need to know what scope the variables is stored within and use syntax like:
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. I think that it's the PageContext.findAttribute() method you were referring to.
 
Agoston Bejo
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I was after that, and am sorry to hear that it's not possible.
And yes, I meant PageContext.findAttribute().
 
Agoston Bejo
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what I actually wanted to say was: thank you!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic