XML-RPC
  1. XML-RPC
  2. XMLRPC-116

XmlRpcServlet.init(...) should support init params using reflection and not only hardcoded support for the init param "enabledForExtensions"

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      XmlRpcServlet currently doesn't support any other init param other than "enabledForExtension" which means that people will have to subclass XmlRpcServlet if they want to set e.g. contentLengthOptional.

      After a discussion in xmlrpc-dev the following solution was decided upon:

      1. iterate over ServletConfig.getInitParameterNames
      2. foreach init param name check if there is a corresponding setter method (setter can only have one argument)
      3. convert init param value to the data type that the setters argument has

      Q: In step 3) what data types should be supported? byte, short, int, long, float, double and String?
      A: Should simply reuse code from the ReflectionUtils. (Don't remember the class name right now, but there is existing functionality, which is used by the AbstractReflectiveXmlRpcHandlerMapping.

      Q: What exception should be thrown (ServletException?) if no matching method can be found in step 2) or data type conversion fails in step 3)?
      A: A ServletException mapping the actual exception (for example
      IllegalArgumentException).

      1. XMLRPC-116.diff
        11 kB
        Jimisola Laursen
      2. XMLRPC-116.diff
        10 kB
        Jimisola Laursen
      3. test.zip
        10 kB
        Jimisola Laursen
      4. XMLRPC-116.diff
        15 kB
        Jimisola Laursen

        Activity

        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12565419 ] jira [ 12599138 ]
        Mark Thomas made changes -
        Workflow jira [ 12384141 ] Default workflow, editable Closed status [ 12565419 ]
        Jochen Wiedmann made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Jochen Wiedmann made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Jimisola Laursen made changes -
        Attachment XMLRPC-116.diff [ 12342418 ]
        Jimisola Laursen made changes -
        Attachment XMLRPC-116.diff [ 12342414 ]
        Jimisola Laursen made changes -
        Attachment test.zip [ 12341340 ]
        Jimisola Laursen made changes -
        Field Original Value New Value
        Attachment XMLRPC-116.diff [ 12341339 ]
        Jimisola Laursen created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Jimisola Laursen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development