Results 1 to 2 of 2

Thread: Binding map keys which contain (nested) brackets ([])

  1. #1
    Join Date
    Aug 2004
    Location
    San Francisco, CA
    Posts
    66

    Default Binding map keys which contain (nested) brackets ([])

    I'm binding several values to a map, and from time to time, the map key will contain square brackets. This results in some html that looks like this:

    Code:
    <input type="text" name="entries&#91;Foo Bar &#40;AA&#41;, N. A. &#91;cr&#93;&#93;" value="" />
    When this is submitted and bound, the key becomes "Foo Bar (AA), N. A. [cr" instead of "Foo Bar (AA), N. A. [cr]", which throws off the whole binding process.

    I've found the offending line of code is in BeanWrapperImpl.java (line 610 in version 1.2.4):

    Code:
    int keyEnd = propertyName.indexOf&#40;PROPERTY_KEY_SUFFIX, keyStart + PROPERTY_KEY_PREFIX.length&#40;&#41;&#41;;
    This returns the first occurence of ']', not the last.

    This seem like a bug to me... anyone have a different opinion on it?

    Regards,
    Christian

  2. #2
    Join Date
    Aug 2004
    Location
    San Francisco, CA
    Posts
    66

    Default

    I've created an issue in jira (http://opensource2.atlassian.com/pro...rowse/SPR-1274), which also includes a patch that resolves this issue.

Similar Threads

  1. Context initialization failed
    By kanonmicke in forum Container
    Replies: 7
    Last Post: Sep 29th, 2005, 12:35 AM
  2. Replies: 7
    Last Post: Sep 13th, 2005, 01:45 AM
  3. Replies: 0
    Last Post: Jul 11th, 2005, 05:49 PM
  4. Replies: 3
    Last Post: Nov 8th, 2004, 07:30 PM
  5. Replies: 2
    Last Post: Aug 17th, 2004, 04:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •