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?
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).
Joined: Nov 07, 2003
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.
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.