Uploaded image for project: 'XWork'
  1. XWork
  2. XW-1017

Delegate XWorkConverter conversion to Jakarta Commons ConvertUtils if a type is registered

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.0-beta1
    • 1.0-beta1
    • Interceptors
    • None

    Description

      I have been playing with adding in support for Commons Bean utils ConvertUtils class to provide the fallback converter if no action:property ognl converter class is registered. I have achieved it by adding this code at the start of doConvert (as well as using my fix to XW-49)

      Object doConvert(Map context, Object value, Class toType)
      {
      /**

      • delegate to ConvertUtils if the type is registered
        */
        if (ConvertUtils.lookup(toType) != null)
        Unknown macro: { if (value instanceof String) { return ConvertUtils.convert((String)value, toType); } else if (toType.equals(String.class)) { return ConvertUtils.convert(value); } }

        ...
        }

      Attachments

        Activity

          People

            Unassigned Unassigned
            cameronbraid Cameron Braid
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: