Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-2307

Change the properties HashMap of the RequestUtils.populate method to a LinkedHashMap

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • Future
    • None
    • Unknown
    • None
    • Operating System: All
      Platform: All
    • 32614

    Description

      The populate method of org.apache.struts.util.RequestUtils with the following
      signature

      public static void populate(
      Object bean,
      String prefix,
      String suffix,
      HttpServletRequest request)
      throws ServletException {
      ..
      }

      uses a "properties" HashMap for storing request parameters passed in from an
      HTTP request.

      Please change this to an java.util.LinkedHashMap so that the
      order of the parameters (when posted through an HTML form) is retained.
      The "properties" map is eventually passed to the BeanUtils.populate(...)
      method. Since this method calls indexed setter/getter methods in the order of
      the entries in the map passed to it. It only makes sense to have this order
      in line with whats submitted.

      Not doing so, is causing erratic behavior when dealing with indexed properties
      in Struts.

      Attachments

        Activity

          People

            Unassigned Unassigned
            apota@dmotorworks.com Alok Pota
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: