File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes EL discussion in HF S&J 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 discussion in HF S&J" Watch "EL discussion in HF S&J" New topic
Author

EL discussion in HF S&J

Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
Bryan, Kathy and Bert,

When I took the beta exam, I found the EL questions were very tricky, so even I havent thought of before.

How in-depth discussion will the book do?

In addition, sometimes, I think we may need simple EL, and EL is more useful for object retrival in scope, and for Collection objects with JSTL tag for display. Besides this, when would we concern about EL at all?

Nick


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Rajan Chinna
Ranch Hand

Joined: Jul 01, 2004
Posts: 320
I got one question

Why EL functions are defined static ?
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
One of the reasons I think of is, we cannot new an object of EL explicitly, and thus, we can only invoke it via static way.

Nick
Surasak Leenapongpanit
Ranch Hand

Joined: May 10, 2002
Posts: 341
How many EL questions in SCWCD?
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
It is an important (and new) topics in SCWCD 1.4.

I havent taken the live exam, so I dont know. But in the beta exams, there were around 40 out of 170 questions, which is around one-fourth of the total number of questions.

Nick
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
Howdy -- there are not many EL questions on the real exam now (many questions are thrown out during the beta if they are too difficult or too misleading). You might have somewhere around 6 questions that are *explicitly* testing your knowledge and understanding of EL. However, there *are* other questions on the exam where EL syntax is used as part of the code example, even though there is nothing wrong or tricky about the EL.

So... it might *look* like there are a LOT of EL questions, but this is really like saying there are a LOT of questions on method syntax on the SCJP, when only a handfull of questions in that exam are actually testing your knowledge of, say, method signature rules, etc.

If you *know* the basics of EL, you will be able to get through all the non-EL questions that simply USE some EL in the example, but you have to know it WELL to get through the other 5 or 6 that are actually looking for your real knowledge of EL.

Does that make sense?

The most significant point of EL is that it's a mechanism for simplifying your JSP code in a way that makes more sense for non-Java page designers, and is more maintainable. The point is trying to move away from having scripting code in your JSP, and EL is a big part of that (along with custom tags including JSTL).

cheers,
Kathy
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
Many EL questions are dropped after the beta

BTW, as asked by someone in other thread, I am interested as well, about the use of EL and JSTL. Does they only be used for presentation? Could I modify Java object (say, update the balance from 100 to 200) via JSTL and EL?

It seems to me that it is not possible, but I just wanna confirm this.

Thanks

Nick
Bryan Basham
author
Ranch Hand

Joined: Apr 30, 2001
Posts: 199
Hi Nick,

Originally posted by Nicholas Cheung:
BTW, as asked by someone in other thread, I am interested as well, about the use of EL and JSTL. Does they only be used for presentation? Could I modify Java object (say, update the balance from 100 to 200) via JSTL and EL?


Currently (in JSP v2.0), the EL language is strictly read-only; you cannot set values. However, the JSF EL-variant does support setting values. There is a JSP v2.1 effort (in progress) that is trying to reconcile the two EL variants to come up with a common language. BTW, EL originally came from JSTL v1.0 about three years ago after the JSP v1.2 spec. EL was merged into JSP v2.0 and the JSTL v1.1 maintance release uses that EL-variant.

JSTL has a tag called 'set' which does allow setting bean properties (similar to the jsp:setProperty std action) as well as collection elements.

Neither JSTL nor EL (currently) allow you to call arbitrary methods on objects. For example, if you have a banking account object with a 'deposit(amount)' method, there would be no way a JSP could call this method using JSTL or EL. Of course, in an MVC architecture, we would cut off your fingers for doing this.

Cheers,
Bryan
[ October 22, 2004: Message edited by: Bryan Basham ]
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
Bryan,

Thanks for the info.

Seems to me that the architect team tries to work out a common language for both JSTL and JSF is becos JSF is included in J2EE 1.4, isnt it?

Anyway, as EL belongs to presentation layer, I dont think it is good for EL to perform any updates!

Nick
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EL discussion in HF S&J