aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes EL doubt? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "EL doubt?" Watch "EL doubt?" New topic
Author

EL doubt?

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9426
    
    2

Guys,

Any reason as to why the following does not work?

<% request.setAttribute( "anAttribute", ${aValueFromEL} ); %>


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

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.


[My Blog]
All roads lead to JavaRanch
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9426
    
    2

So the point is Expression Language cannot be used in scriptlets!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9426
    
    2

Is there any reverse situation?
nitin pai
Ranch Hand

Joined: May 30, 2006
Posts: 185
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

Joined: Sep 26, 2006
Posts: 9426
    
    2

I was just vague in my thoughts!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EL doubt?