• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using JSTL/EL to access page variable

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know that EL is working (2.4 DTD on weblogic 9.2) as ${pageContext.request.requestURI} is rendering correctly, but I'm having difficulty declaring a variable in the page and referencing it later on, specifically:

<%
boolean myBoolean = true;
%>

...

<c:out value="${pageScope.myBoolean}" />

I've got jstl-1.1.jar and standard-1.1.jar deployed in my WEB-INF/lib

Thanks in advance
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your variable needs to be bound to one of the scope objects (like request) before it can be accessed from EL.

Why are you trying to mix the two?
[ February 08, 2008: Message edited by: Ben Souther ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Indeed. The JSTL and EL, meant to eradicate scriptlets, are purposefully designed to not interact with scripting variables.

pageScope does not address scripting variables, but scoped variables placed into page scope.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic