In below there is question and answer, What I need is I want comment about the a
ID: 3588571 • Letter: I
Question
In below there is question and answer, What I need is I want comment about the answer( feel free to agree or disagree with answer) in few paragraph
QUESTION:
What are some of the pros and cons of Java Expression Language? Discuss.
ANSWER:
One of the advantages of EL is that the code is much more compact and precise than standard JSP tags. Another advantage is that it allows you to access nested properties. There are two main disadvantages of EL that are mentioned in the textbook. The first is that EL doesn't create a JavaBean if it doesn't already exist. The other disadvantage is that it doesn't provide a way to set properties. In reality, these two aren't really disadvantages because, if you follow the MVC pattern, you'd use a servlet to create a JavaBean and set its properties; you wouldn't do this inside a JSP.
Explanation / Answer
As far as the advantages are concerned , i completely agree with two advantages you have given. You can also add the following advantages to your list :
1. EL is null friendly, It handles unknown or null values so that page still displays even if it can't find an attribute or property key with the name in the expression. In arithmetic, EL treats the null value as zero.. In logical expression EL treats the null value as false.
2. You can also access the collection through EL and perform various operations on collections such as getting an element from the list by its index.
3. Easy maitanability and debugging.
Disadvantages of EL :
1. Since EL is not java and gets translated to java and then compiled to byte code which results in slower performance.
2. Although EL is a language but it is not self contained as you pointed out in your points and its one of the main purpose is to avoid scroplets which are not recommeded.
you don't necessarily need EL but you ca always use it for its various advantages.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.