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

FileUploadInterceptor should clean up even if action throws exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.2.1
    • 2.2.3
    • Core Interceptors
    • None
    • Independent of environment

    • Patch

    Description

      In Struts 2.2.1 (and also in trunk), org.apache.struts2.interceptor.FileUploadInterceptor cleans up uploaded files after the action finishes. The first problem is that the action might throw an exception. FileUploadInterceptor does not use try...finally, so any action exception will result in files not being cleaned up. The second problem is that something earlier in the interceptor stack might throw an exception, in which case FileUploadInterceptor will not even be invoked. The correct solution is for FilterDispatcher to clean up the uploaded files.

      Attachments

        1. patch
          4 kB
          John Lindal

        Activity

          People

            jafl John Lindal
            jafl5272 John Lindal
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: