File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes EL and Scriptlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "EL and Scriptlet" Watch "EL and Scriptlet" New topic

EL and Scriptlet

Micheal John
Ranch Hand

Joined: Nov 01, 2006
Posts: 344
How can we declare the variable in EL? Is't possible to do all the operations done by scriptlet (expression, declaration and scriptlet) in EL?

I know the expression can be done at EL:

For Example:
<%! String str = "Hello"; %> // for this???
<% request.setAttribute("hi",str); %> //<c:set...>
<%= request.getAttribute("hi"); %> // ${}

Whether there will be only one uri per tld file?
[ January 10, 2007: Message edited by: Micheal John ]

Micheal John
SCJP 1.4 (86%), SCWCD 1.4 (86%), SCBCD 1.3 (85%), SCDJWS (Just Started...) - Satisfaction Lies in Our EFFORT, Not in the ATTAINMENT
Sanjeev Singh
Ranch Hand

Joined: Nov 01, 2006
Posts: 381
<%! String str = "Hello"; %> // for this???

I dont think you can write a EL to get the value of str!

~Sanjeev Singh<br />SCJP 1.5
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

use c:set with "page" scope.

[My Blog]
All roads lead to JavaRanch
Sanjeev Singh
Ranch Hand

Joined: Nov 01, 2006
Posts: 381
Yes Satou,
You are right.
I agree. Here's the link:
subject: EL and Scriptlet
It's not a secret anymore!