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

MessageStorePreResultListener doesn't store messages for 3rd-party RedirectResult subclasses

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.28
    • Fix Version/s: 2.3.29, 2.5.1
    • Component/s: None
    • Labels:
      None

      Description

      My team uses a custom subclass of ServletRedirectResult, e.g. "org.tdar.struts.ServletRedirectResult". After updating to 2.3.8 our messages no longer survive a redirect. I believe the problem lies with this section of MessageStorePreResultListener:

      if (resultConfig != null) {
          isRedirect = ServletRedirectResult.class.getName().equals(resultConfig.getClassName())
                  || ServletActionRedirectResult.class.getName().equals(resultConfig.getClassName());
      }
      

      Per the discussion in WW-4605, the following change could likely resolve the issue:

      if (resultConfig != null) {
          isRedirect = ServletRedirectResult.class.isAssignableFrom(Class.forName(resultConfig.getClassName()));
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lukaszlenart Lukasz Lenart
                Reporter:
                jtdevos Jim deVos
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: