Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL doubt?

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

Any reason as to why the following does not work?

<% request.setAttribute( "anAttribute", ${aValueFromEL} ); %>
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Expressions cannot be used in scriptlet. Scriptlets are pure java. Put the same in a simple java file and try to compile. You'll get a compilation error.
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So the point is Expression Language cannot be used in scriptlets!
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any reverse situation?
 
nitin pai
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you havent got the whole point of why EL was formed.
It was formed to avoid java scriptlets in a JSP page for web page designers. The reverse is not true since you are not going to design a web page using java.

Its like a wrapper over the underlying scriptlet for ease of use.
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was just vague in my thoughts!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic