Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-6902

@ResponseBody does not work with @ExceptionHandler

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.1
    • Fix Version/s: 3.1 M1
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      When this method is executed

      @ExceptionHandler
      @ResponseBody
      public String dummyExceptionHandler(Exception e) {
          return e.getMessage();
      }
      

      Spring mvc tries to resolve the view using the method output --> 404.
      As the method is annotated with @ResponseBody, it should directly write the method output to the response.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                arjen.poutsma Arjen Poutsma
                Reporter:
                framiere Florent Ramiere
                Last updater:
                Spring Issuemaster
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  40 weeks, 1 day ago

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 1.25h
                  1.25h