Two Laptop Bag*
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 14687

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
Similar Threads
looking for quick reference to jsp taglibs
Passing values to param value dynamically in jsp
Content of JSTL test attributes
Qn from JSP Spec
doubt in value for rtexprvalue element in tld