Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-559

HtmlJsValueSet: smaller JavaScript code size, nested maps and collections, correct string escaping

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0.9m9
    • 1.1.1
    • None
    • None

    Description

      Note: patch file following

      • smaller generated Javascript code size:

      The current version initializes array elements in separate statements, whereas my version initializes them in the array constructor, e.g.

      current version:

      var a = new Array();
      a[0] = 'foo';
      a[1] = 'bar';
      ...

      new version:

      var a = new Array('foo','bar',...);

      This is important for big arrays containing (textual) small values in small-bandwidth environments and has no drawbacks.

      • support for nested collections and maps:

      Collections of collections, maps of collections, maps of maps of collections, etc. are supported. The nesting level is not limited (but will be, in practice, limited by stack size or the javascript interpreter).

      • correct JavaScript string escaping:

      The new version uses StringEscapeUtils.escapeJavaScript() from the Jakarta Commons Lang library for generating JavaScript string constants.

      Attachments

        1. jsvalueset.diff
          9 kB
          Timo Thomas

        Activity

          People

            mmarinschek Martin Marinschek
            tider Timo Thomas
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: