This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "EL and Scriptlet" Watch "EL and Scriptlet" New topic
Author

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é
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: EL and Scriptlet