Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3666

TypeConverter should trim before conversion to things that are not Strings

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.2.1.1
    • 6.7.0
    • Value Stack
    • None
    • Standard Struts2 implementation with Jetty

    Description

      For a simple struts2 application, when you pass in parameters that are not "Strings" for example Longs or Enums the Xwork2 TypeConverter (and Struts2's handling) needs some work.

      Issues:

      • numeric values are not properly parsed if they have space characters
      • enum values are not properly parsed if they have space characters
      • ideally some exception would bubble back up in the form of an ActionError

      Attached (in comments) is a simple controller and test case using HTMLUnit to demonstrate the issue. Even with the following logger settings, no errors are visible:

      log4j.logger.org.apache.struts2=TRACE
      log4j.logger.com.opensymphony.xwork2=TRACE
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            abrin adam brin
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: