File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Using JSTL/EL to access page variable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Using JSTL/EL to access page variable" Watch "Using JSTL/EL to access page variable" New topic

Using JSTL/EL to access page variable

Steve J Holmes

Joined: Feb 08, 2008
Posts: 4
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;


<cut value="${pageScope.myBoolean}" />

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

Thanks in advance
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

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 ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63542

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.

[Asking smart questions] [About Bear] [Books by Bear]
subject: Using JSTL/EL to access page variable
It's not a secret anymore!