• Post Reply Bookmark Topic Watch Topic
  • New Topic

EL in not working

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all.
I have a simple servlet that creates an array list of persons objects than forwards the request to a JSP page to display it.
this JSP page uses EL and the attribute :
<%@ page isELIgnored="false" %>
here some code (yes, it is not the best approach, but I just want to use EL)

but this page doesn't display anything at all and if I wrote :
<td><%= p.getId( ) %></TD>
every thing is OK !
any ideas ?
by the way, I'm using Tomcat 5.0.28
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're mixing apples with staplers.

The EL operates upon scoped variables. In your example, p is a scripting variable. Since one of the purposes of the EL is to elimiinate on-page scripting, never the two shall meet.

To reference scripting variables, you will need to use scripting expressions.

Better yet, embrace Model 2 and scriptless pages and use the EL to make your life a better one.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your example using JSTL and EL:


[ January 18, 2005: Message edited by: Bear Bibeault ]
 
sun ram
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do use script let in JSP 2.0
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!