• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using JSTL/EL to access page variable

 
Steve J Holmes
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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;
%>

...

<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
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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 ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic