javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2507

Bug in <ui:debug> in environments which use URL parameters themselves (e.g. Spring Webflow)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Incomplete
    • Affects Version/s: 2.0.6
    • Fix Version/s: None
    • Component/s: facelets
    • Labels:
      None
    • Environment:

      Mojarra 2.0.6, Spring Webflow 2.3

      Description

      Crosscopy from http://java.net/jira/browse/FACELETS-312:

      --------------
      When using <ui:debug> tag in JSF views managed by Spring WebFlow, the debug window opens with a server side error:
      java.lang.NumberFormatException: For input string: "1?facelets.ui.DebugOutput=1209388398877"

      The reason is that UIDebug.encodeBegin assumes that action URL has no URL parameters in it, what is not true for SWF (action URL is of form
      '/monitoring/spring/get?execution=c1v1') The UIDebug code should check whether action URL contains URL parameters and append '?' or '&' correspondingly.
      ---------------

      Possible solution (taken from http://datenschwanz.net/2009/12/31/facelets-uidebug-and-spring-web-flow/):

      — src/java/com/sun/facelets/tag/ui/UIDebug.java.orig 2009-10-15 10:03:16.000000000 -0500
      +++ src/com/sun/facelets/tag/ui/UIDebug.java 2009-12-31 12:45:57.000000000 -0600
      @@ -75,7 +75,7 @@
      sb.append("function faceletsDebug(URL)

      { day = new Date(); id = day.getTime(); eval(\"page\" + id + \" = window.open(URL, '\" + id + \"', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = 240,top = 212');\"); }

      ;");
      sb.append("var faceletsOrigKeyup = document.onkeyup; document.onkeyup = function(e) { if (window.event) e = window.event; if (String.fromCharCode(e.keyCode) == '" + this.getHotkey() + "' & e.shiftKey & e.ctrlKey) faceletsDebug('");
      sb.append(actionId);

      • sb.append('?');
        + sb.append(actionId.contains("?") ? '&' : '?');
        sb.append(KEY);
        sb.append('=');
        sb.append(writeDebugOutput(faces));

        Issue Links

          Activity

          Hide
          rogerk added a comment -

          Looms like the code in 2.0.6 is doing the right thing:

          sb.append(actionId);
          sb.append(actionId.indexOf('?')==-1 ? '?' : '&');
          sb.append(KEY);
          sb.append('=');
          sb.append(writeDebugOutput(faces));
          sb.append("'); else if (faceletsOrigKeyup) faceletsOrigKeyup(e); };\n");
          sb.append("//]]>\n");

          can you provide a test case?

          Show
          rogerk added a comment - Looms like the code in 2.0.6 is doing the right thing: sb.append(actionId); sb.append(actionId.indexOf('?')==-1 ? '?' : '&'); sb.append(KEY); sb.append('='); sb.append(writeDebugOutput(faces)); sb.append("'); else if (faceletsOrigKeyup) faceletsOrigKeyup(e); };\n"); sb.append("//]]>\n"); can you provide a test case?
          Hide
          Manfred Riem added a comment -

          Can you attach an example application (with sources) that demonstrates the problem? Can you verify if it still an issue on the latest 2.1 release?

          Show
          Manfred Riem added a comment - Can you attach an example application (with sources) that demonstrates the problem? Can you verify if it still an issue on the latest 2.1 release?
          Hide
          Manfred Riem added a comment -

          Lowering priority because of no response

          Show
          Manfred Riem added a comment - Lowering priority because of no response
          Hide
          rogerk added a comment -

          The code in 2.0.6 and subsequent versions look like they do what you mention.
          If you feel otherwise, please attach a test case that illustrates the issue.

          Show
          rogerk added a comment - The code in 2.0.6 and subsequent versions look like they do what you mention. If you feel otherwise, please attach a test case that illustrates the issue.

            People

            • Assignee:
              rogerk
              Reporter:
              ssteiger
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: