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

Setting status code in HttpHeaders will be ignored

    Details

      Description

      Setting the status code for validation has no effect.

      <constant name="struts.rest.validationFailureStatusCode" value="406"/>
      

      Inside of the RestWorkflowInterceptor this status code is used:

                  	HttpHeaders info = new DefaultHttpHeaders()
                  	    .disableCaching()
                  	    .renderResult(method)
                  	    .withStatus(validationFailureStatusCode);
      

      But the result has still a 200 success result.

      1. WW-4545.patch
        1 kB
        Johannes Geppert

        Activity

        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Struts-JDK6-support-2.3 #940 (See https://builds.apache.org/job/Struts-JDK6-support-2.3/940/)
        WW-4545 - Setting status code in HttpHeaders will be ignored (amashchenko: rev f2958524823a2b514aa5de239d264cf6a622297d)

        • plugins/rest/src/main/java/org/apache/struts2/rest/DefaultContentTypeHandlerManager.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Struts-JDK6-support-2.3 #940 (See https://builds.apache.org/job/Struts-JDK6-support-2.3/940/ ) WW-4545 - Setting status code in HttpHeaders will be ignored (amashchenko: rev f2958524823a2b514aa5de239d264cf6a622297d) plugins/rest/src/main/java/org/apache/struts2/rest/DefaultContentTypeHandlerManager.java
        Hide
        aleksandr-m Aleksandr Mashchenko added a comment -

        Done.

        Show
        aleksandr-m Aleksandr Mashchenko added a comment - Done.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit f2958524823a2b514aa5de239d264cf6a622297d in struts's branch refs/heads/support-2-3 from Johannes Geppert
        [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=f295852 ]

        WW-4545 - Setting status code in HttpHeaders will be ignored

        (cherry picked from commit 4cd9a74cb8efa8dc0d3c57ac267a70b0538f3bf0)

        Show
        jira-bot ASF subversion and git services added a comment - Commit f2958524823a2b514aa5de239d264cf6a622297d in struts's branch refs/heads/support-2-3 from Johannes Geppert [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=f295852 ] WW-4545 - Setting status code in HttpHeaders will be ignored (cherry picked from commit 4cd9a74cb8efa8dc0d3c57ac267a70b0538f3bf0)
        Hide
        jogep Johannes Geppert added a comment -

        +1 for cherry picking

        Show
        jogep Johannes Geppert added a comment - +1 for cherry picking
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        Aleksandr Mashchenko you can cherry-pick the commit into support-2-3 branch

        Show
        lukaszlenart Lukasz Lenart added a comment - Aleksandr Mashchenko you can cherry-pick the commit into support-2-3 branch
        Hide
        aleksandr-m Aleksandr Mashchenko added a comment -

        Johannes Geppert Woks for me as well. Maybe we should add this fix for 2.3.x? WDYT?

        Show
        aleksandr-m Aleksandr Mashchenko added a comment - Johannes Geppert Woks for me as well. Maybe we should add this fix for 2.3.x? WDYT?
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Struts-JDK7-master #371 (See https://builds.apache.org/job/Struts-JDK7-master/371/)
        WW-4545 - Setting status code in HttpHeaders will be ignored (jogep: rev 4cd9a74cb8efa8dc0d3c57ac267a70b0538f3bf0)

        • plugins/rest/src/main/java/org/apache/struts2/rest/DefaultContentTypeHandlerManager.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Struts-JDK7-master #371 (See https://builds.apache.org/job/Struts-JDK7-master/371/ ) WW-4545 - Setting status code in HttpHeaders will be ignored (jogep: rev 4cd9a74cb8efa8dc0d3c57ac267a70b0538f3bf0) plugins/rest/src/main/java/org/apache/struts2/rest/DefaultContentTypeHandlerManager.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Struts-JDK7-master #353 (See https://builds.apache.org/job/Struts-JDK7-master/353/)
        WW-4545 - Setting status code in HttpHeaders will be ignored (jogep: rev 4cd9a74cb8efa8dc0d3c57ac267a70b0538f3bf0)

        • plugins/rest/src/main/java/org/apache/struts2/rest/DefaultContentTypeHandlerManager.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Struts-JDK7-master #353 (See https://builds.apache.org/job/Struts-JDK7-master/353/ ) WW-4545 - Setting status code in HttpHeaders will be ignored (jogep: rev 4cd9a74cb8efa8dc0d3c57ac267a70b0538f3bf0) plugins/rest/src/main/java/org/apache/struts2/rest/DefaultContentTypeHandlerManager.java
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 4cd9a74cb8efa8dc0d3c57ac267a70b0538f3bf0 in struts's branch refs/heads/master from Johannes Geppert
        [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=4cd9a74 ]

        WW-4545 - Setting status code in HttpHeaders will be ignored

        Show
        jira-bot ASF subversion and git services added a comment - Commit 4cd9a74cb8efa8dc0d3c57ac267a70b0538f3bf0 in struts's branch refs/heads/master from Johannes Geppert [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=4cd9a74 ] WW-4545 - Setting status code in HttpHeaders will be ignored
        Hide
        jogep Johannes Geppert added a comment -

        This patch solves the Issue for me.

        Show
        jogep Johannes Geppert added a comment - This patch solves the Issue for me.

          People

          • Assignee:
            Unassigned
            Reporter:
            jogep Johannes Geppert
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development