Women in Technology

Hear us Roar



Article:
  JSP 2.0: The New Deal, Part 1
Subject:   EL - I just don't get it!
Date:   2003-11-07 21:03:01
From:   anonymous2
I just don't get it.. instead of using java scriptlets in JSP let's learn yet another language .. EL?


call me crazy.. but are people following the mantra "no java code in jsp" ok.. so let's put some EL code instead?


I must be missing some point here.

Full Threads Oldest First

Showing messages 1 through 7 of 7.

  • EL - I just don't get it!
    2003-11-11 10:55:12  anonymous2 [View]

    Chalk up one more person that just doesn't get it. One more language makes no sense to me.



    • EL - I just don't get it!
      2003-11-13 18:20:51  dhinojosa [View]

      The other value, is object reference navigation where you didn't have that before. To me that is the most valuable aspect of JSTL.

      For example
      <c:out value="${employee.address.zipCode}"/>
      <c:out value="${employee.401k.provider.address.zipCode}"/>

      This is far better than <jsp:getProperty> as you can only inspect only one level deep.
      • but why is its failure mode so unusable
        2003-11-15 22:59:51  anonymous2 [View]

        I used the JSTL stuff last year, and ended up hating that expression language for the bugs it gave me that took ages to track down.

        EL says 'if something evals to null, the statement evaluates to empty'. Typos turn expressions to null. Errors in your java code where things are initialized and return null, turn expressions to null. Which makes it really hard to track down where is the error in employee.401k.provider.address.zipCode

        For all the expressiveness of the language, if it is hard to develop working code, I dont see the point.

        -steve loughran
        • but why is its failure mode so unusable
          2003-11-29 22:52:16  anonymous2 [View]

          In an MVC environment you can see what evaluates to null in a servlet before rendering to JSP.
    • EL - I just don't get it!
      2003-11-12 07:51:50  anonymous2 [View]

      OK, replying to myself, I've reread this article and it makes a little more sense and makes EL look a little more useful and a little less like one more new thing to learn in order to continue writing JSPs.

      Still I do wonder about all the compications that have been added to JSP in order to simplify it.

  • EL - I just don't get it!
    2003-11-08 15:44:57  psgivens [View]

    Yes, you are missing some thing. An expression language allows a developer to sprinkle necessary logic where a programming language should not be. It allows for good MVC design without making the "view" any less robust.

    Also, because nested <> brackets don't make sense, the el expresion make much more sense than the JSP version.
    <option value="3"
    ${param.artist == 3 ? 'selected' : ''}
    >
    <option value="3"
    <%=param.artist == 3 ? "selected" : "" %>
    >

    Oh, and of course you are missing the main point. JSPs by nature are a templating technology, and as such, need a good templating language so that they are not muddied by code. Perl and .NET have very good ELs, why not Java?

    Phillip S. Givens
    • EL - I just don't get it!
      2003-12-08 09:45:29  anonymous2 [View]

      > Oh, and of course you are missing the main point. JSPs by nature are a templating technology, and as such, need a good templating language so that they are not muddied by code.

      I hate to break it to you, but EL IS code. It may be more limited in functionality than Java, but it's still code.