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

ValidationAware add callable method, called from DefaultWorkflowInterceptor

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.14
    • 2.3.15
    • Core Interceptors
    • None

    Description

      When a form error occurs, the action is unaware of this event. There are situations whereby one should know that a form error has occurred. For example, one may wish to populate the ActionStack with special handling variables or set a flag denoting special logic that the JSP should handle. In short, it isn't unreasonable for one to want to know that a form error occurred and be able to respond to it with more than just a single JSP result attached to "input."

      My suggestion would be within ValidationAware, add a method:
      void actionError()

      Within DefaultWorkflowInterceptor.doIntercept, there is already an if condition of:
      if (validationAwareAction.hasErrors()) {

      at the end of processing that if block, just before, "return resultName;" call validationAwareAction.actionError();

      By the way, this line:
      LOG.debug("Errors on action " + validationAwareAction + ", returning result name 'input'");

      should be:
      LOG.debug("Errors on action " + validationAwareAction + ", returning result name '" + inputResultName + "'");

      Attachments

        Activity

          People

            lukaszlenart Lukasz Lenart
            ericlentz Eric Lentz
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: