struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "COMBEAU (JIRA)" <>
Subject [jira] [Commented] (WW-4750) Why JSONValidationInterceptor return Status Code 400 BAD_REQUEST instead of 200 SUCCESS
Date Mon, 06 Mar 2017 14:45:33 GMT


COMBEAU commented on WW-4750:

So, for me if on the client side it's a human that do the request he can look the status code
and adapt his request till have a status 200.

As mention in my screenshot, the status code 400 returned by the server throw an error in
jQuery side. This is not my source code it's in the jQuery source code where you can see the

But if you have some business rules validation on the server side because you have to check
some datas with webservices or database or anything else you can't do this on the client side
via JavaScript function. You can have many others errors that is not due to malformed syntax.

In this case, it's not malformed syntax and 4xx shouldn't be return.

> Why JSONValidationInterceptor return Status Code 400 BAD_REQUEST instead of 200 SUCCESS
> ---------------------------------------------------------------------------------------
>                 Key: WW-4750
>                 URL:
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JSON
>    Affects Versions: 2.5.10
>         Environment: Jdk 1.7, Windows 10, jQuery 1.7.2
>            Reporter: COMBEAU
>            Priority: Minor
>              Labels: docuentation, json, validation
>             Fix For:
>         Attachments: Issue in jQuery 1.7.2.png
> Since I have made the upgrade of my Struts 2.5.8 to 2.5.10, all my POST Ajax call via
jQuery with the parameter "struts.enableJSONValidation=true" return status code 400 Bad Request
when my validation on server side is wrong. 
> And I have an issue in the caller jQuery.
> {quote}
> Failed to load resource: the server responded with a status of 400 (Bad Request)
> {quote}
> Before in 2.5.8 and all previous versions the status code was 200.
> What is the reason of this changes because jQuery doesn't understand this and it's problematic.
I see this [WW-4728|] but in this bug it was
not mention that the status code has to be changed.
> Please provide example in the documentation if the reason of the change is a specific
> Thank you in advance for your help.
> Best regards,

This message was sent by Atlassian JIRA

View raw message