Tapestry
  1. Tapestry
  2. TAPESTRY-2483

The '%' symbol passed to RenderSupport.addScript() is treated as a formatting directive, causing errors

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.13
    • Fix Version/s: 5.0.14
    • Component/s: Core Components
    • Labels:
      None

      Description

      Tapestry throws a Render queue error when the addScript contains the @ symbol.

      The @ symbol is converted to
      %40 and the following script is added with addScript:

      new pageLinkPopup("pagelinkpopup", "user/edit/m.brinkers%40pobox.com",
      "edit user", "width=600,height=300");

      But, this results in:

      Render queue error in BeginRender[Users:pagelinkpopup]: Conversion = 'p'

      Stack trace

      • java.util.Formatter
        $FormatSpecifier.conversion(Formatter.java:2605)
      • java.util.Formatter
        $FormatSpecifier.<init>(Formatter.java:2633)
      • java.util.Formatter.parse(Formatter.java:2479)
      • java.util.Formatter.format(Formatter.java:2413)
      • java.util.Formatter.format(Formatter.java:2366)
      • java.lang.String.format(String.java:2770)
      • org.apache.tapestry5.internal.services.RenderSupportImpl.addScript(RenderSupportImpl.java:129)

        Activity

        Hide
        Howard M. Lewis Ship added a comment -

        The URL was encoded, so the @ became %40.

        When fed to RenderSupport.addScript(), the %40 looks like a replacement point (like %s or %d).

        I think the solution is to have an addScript() method on RenderSupport that does not invoke java.lang.String.format().

        Show
        Howard M. Lewis Ship added a comment - The URL was encoded, so the @ became %40. When fed to RenderSupport.addScript(), the %40 looks like a replacement point (like %s or %d). I think the solution is to have an addScript() method on RenderSupport that does not invoke java.lang.String.format().

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Martijn Brinkers
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development