Jetty
  1. Jetty
  2. JETTY-756

JSP tag using ternary operator appears to mandate spaces between expression

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 6.1.12.rc3
    • Fix Version/s: 8.0.0.M0
    • Component/s: JSP
    • Labels:
      None
    • Environment:
      Eclipse 3.4, Maven 2.0.9, maven-jetty-plugin 6.0.12.rc12
    • Number of attachments :
      0

      Description

      This ones a bit annoying, but hopefully easy to fix. While testing the migration from an Eclipse+Ant+Tomcat5.5 environment to doing a (side-by-side) Eclipse+Maven+JettyPlugin I've run across what appears to be an "AnalSpec" problem. It appears Jetty and it's shipped jasper compiler seems to mandate spaces inside some of the tag definitions.

      So this doesn't work:

      <c:set var="href" value="$

      {(empty href)?'#':href}

      "/>

      But this does:

      <c:set var="href" value="$

      {(empty href) ? '#' : href}

      "/>

      All 3 spots must have spaces for this to work.

      Doing some browsing, it appears Tomcat 6.x initially had this problem too:

      http://issues.apache.org/bugzilla/show_bug.cgi?id=42565

      While the workaround on a tag by tag basis is reasonably trivial, it's a bit of a PITA for a lot of tags like what we have.

      So happy to leave the bug as minor but if there was a "PITA" field in JIRA I'd mark it as "haemorrhoid" level.

        Activity

        Hide
        Greg Wilkins added a comment -

        why oh why is there not a jasper JSP engine that we can consume as a maven artifact????

        I'll look to see if we can get this patch into the fork that we patch to build our JSP. Failing that, we'll see if we can patch it ourselves.

        Not sure this will make it for 6.1.12.... but will try

        Show
        Greg Wilkins added a comment - why oh why is there not a jasper JSP engine that we can consume as a maven artifact???? I'll look to see if we can get this patch into the fork that we patch to build our JSP. Failing that, we'll see if we can patch it ourselves. Not sure this will make it for 6.1.12.... but will try
        Hide
        Paul Smith added a comment -

        happy to try a different version, I'm only just starting the transition. Should I try 7.x? I wasn't sure which was 'stable' versus 'beta' etc and stumbled on 6. Really I'm driven by what version the 'maven-jetty-plugin' is ?

        Show
        Paul Smith added a comment - happy to try a different version, I'm only just starting the transition. Should I try 7.x? I wasn't sure which was 'stable' versus 'beta' etc and stumbled on 6. Really I'm driven by what version the 'maven-jetty-plugin' is ?
        Hide
        Jan Bartel added a comment -

        Paul,

        We use the JSP engine from Glassfish, which uses Sun's reference implementation of the EL api whereas Tomcat uses Apache's EL implementation, so the patch won't be able to be directly applied. I've raised an issue on Sun's UEL project which seems to be the home of the Sun reference impl: https://uel.dev.java.net/issues/show_bug.cgi?id=2

        For good measure (and as Glassfish seems to have its own checkin of the com.sun.el classes) I've also raised it on Glassfish issue tracker here:
        https://glassfish.dev.java.net/issues/show_bug.cgi?id=6589

        FYI I also tried a more recent version of Glassfish JSP but it exhibits the same behaviour.

        I encourage you to go to the projects and vote for that issue to ensure it comes to the attention of the developers.

        cheers
        Jan

        Show
        Jan Bartel added a comment - Paul, We use the JSP engine from Glassfish, which uses Sun's reference implementation of the EL api whereas Tomcat uses Apache's EL implementation, so the patch won't be able to be directly applied. I've raised an issue on Sun's UEL project which seems to be the home of the Sun reference impl: https://uel.dev.java.net/issues/show_bug.cgi?id=2 For good measure (and as Glassfish seems to have its own checkin of the com.sun.el classes) I've also raised it on Glassfish issue tracker here: https://glassfish.dev.java.net/issues/show_bug.cgi?id=6589 FYI I also tried a more recent version of Glassfish JSP but it exhibits the same behaviour. I encourage you to go to the projects and vote for that issue to ensure it comes to the attention of the developers. cheers Jan
        Hide
        Paul Smith added a comment -

        I've had all our UI team go and vote for those issues, we'll see how we go...

        Show
        Paul Smith added a comment - I've had all our UI team go and vote for those issues, we'll see how we go...
        Hide
        Jan Bartel added a comment -

        dyu,

        The comment on the glassfish issue shows that kchung committed a fix for this issue on 31st January. Can you find out where this fix was done: was it in v3 of glassfish, or was it in the jsp sub-project. Either way, can you work out if there is a way for us to get this fix into jetty jsp?

        thanks
        Jan

        Show
        Jan Bartel added a comment - dyu, The comment on the glassfish issue shows that kchung committed a fix for this issue on 31st January. Can you find out where this fix was done: was it in v3 of glassfish, or was it in the jsp sub-project. Either way, can you work out if there is a way for us to get this fix into jetty jsp? thanks Jan
        Hide
        David Yu added a comment -

        Jan,

        The fix is in v3. ( v2.1 has been FCS'ed but no release date yet)
        So most likely we'll have to wait for the next v2.1 release.

        P.S. Their jsp subproject is inactive.

        Cheers

        Show
        David Yu added a comment - Jan, The fix is in v3. ( v2.1 has been FCS'ed but no release date yet) So most likely we'll have to wait for the next v2.1 release. P.S. Their jsp subproject is inactive. Cheers
        Hide
        Jan Bartel added a comment -

        Dyu,

        Currently we're using the tags that start with 9_1_1, so that implies that we're on the 1.x version stream of glassfish, is that correct? Can you evaulate and recommend if we should switch to the v2 or the v3 tags of the jasper module for jetty? Please try out both v2, v3 and the jsp sub-project code with jetty as part of your evaulation.

        thanks
        Jan

        Show
        Jan Bartel added a comment - Dyu, Currently we're using the tags that start with 9_1_1, so that implies that we're on the 1.x version stream of glassfish, is that correct? Can you evaulate and recommend if we should switch to the v2 or the v3 tags of the jasper module for jetty? Please try out both v2, v3 and the jsp sub-project code with jetty as part of your evaulation. thanks Jan
        Hide
        David Yu added a comment -

        Actually the jasper module that jetty6 imports is from glassfish v2 already. (w/c contains the fix for this on the next upcoming release)

        Show
        David Yu added a comment - Actually the jasper module that jetty6 imports is from glassfish v2 already. (w/c contains the fix for this on the next upcoming release)
        Hide
        Jan Bartel added a comment -

        To paraphrase, glassfish has the fix in trunk and we're waiting for a relase, which will be the v2 series.

        Jan

        Show
        Jan Bartel added a comment - To paraphrase, glassfish has the fix in trunk and we're waiting for a relase, which will be the v2 series. Jan
        Hide
        Jan Bartel added a comment -

        Paul,

        It seems sun will not release this fix with the v2 series. However there is a chance that you might be able to drop in the el jars from v3 and it might work. I have asked for clarification from the glassfish project of which releases and jars this fix is actually in, as it is not obvious from their svn commits.

        cheers
        Jan

        Show
        Jan Bartel added a comment - Paul, It seems sun will not release this fix with the v2 series. However there is a chance that you might be able to drop in the el jars from v3 and it might work. I have asked for clarification from the glassfish project of which releases and jars this fix is actually in, as it is not obvious from their svn commits. cheers Jan
        Hide
        Paul Smith added a comment -

        Sounds like the usual from Sun..

        We have managed to work around this by just doing an complex regular expression search and replace. Be nice to fix this (not that you have to, Sun has to release this) because it's these sorts of subtle differences in implementations of the spec between, say, Jetty and Tomcat that make all our lives.. fun..

        thanks heaps for following up!

        Show
        Paul Smith added a comment - Sounds like the usual from Sun.. We have managed to work around this by just doing an complex regular expression search and replace. Be nice to fix this (not that you have to, Sun has to release this) because it's these sorts of subtle differences in implementations of the spec between, say, Jetty and Tomcat that make all our lives.. fun.. thanks heaps for following up!
        Hide
        Jan Bartel added a comment -

        Paul,

        Jetty-8 now uses glassfish v3's implementation of the uel (its version 2.2, along with jsp 2.2). So that should have the fix for this issue in it. Unfortunately I haven't been able to ascertain if this fix is in a glassfish v2 release. I'm going to close this issue for now, but if you find out that this has been included in a glassfish v2 release, please reopen and let me know the release number so we can update the version of jsp used in jetty < 8.

        thanks,
        Jan

        Show
        Jan Bartel added a comment - Paul, Jetty-8 now uses glassfish v3's implementation of the uel (its version 2.2, along with jsp 2.2). So that should have the fix for this issue in it. Unfortunately I haven't been able to ascertain if this fix is in a glassfish v2 release. I'm going to close this issue for now, but if you find out that this has been included in a glassfish v2 release, please reopen and let me know the release number so we can update the version of jsp used in jetty < 8. thanks, Jan

          People

          • Assignee:
            Jan Bartel
            Reporter:
            Paul Smith
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: