Uploaded image for project: 'Commons OGNL (Dormant)'
  1. Commons OGNL (Dormant)
  2. OGNL-80

CastCastException when setting properties on objects that use generics in superclass properties

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.7.2
    • None
    • None

    Description

      From the original Struts ticket - https://issues.apache.org/struts/browse/WW-1495:

      When the action class extends a class that uses generics (e.g. public class ManageEmployeeAction extends CrudAction<Employee, Long> { }) and data is sent from the web page (using Struts Forms built by the tag library) to be set in a property from the class that is inherited from the superclass and defined as generic (e.g., protected I[] ids, OGNL cannot determine the type of the property, falls back to String[] and throws a ClassCastException.

      This issue has been further discussed in the forum: http://forums.opensymphony.com/thread.jspa?threadID=48752. Attachments are provided to illustrate the issue and propose a starting point for the fix. However, it should NOT be considered a patch, since the creator of this "hack" doesn't have enough knowledge of OGNL and Generics to assure its general correctness.

      Attachments

        Issue Links

          Activity

            People

              jkuhnert Jesse Kuhnert
              mrdon Donald J. Brown
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: