[ 
https://issues.apache.org/jira/browse/WW-4684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15459432#comment-15459432
 ] 

COMBEAU edited comment on WW-4684 at 9/3/16 9:33 AM:
-----------------------------------------------------

I have attached the version of my struts.xml when I am using Struts 2.3.28.

In the file you can see that I have defined in my "defaultStack" :
<interceptor-ref name="json">
        <param name="contentType">application/json</param>
</interceptor-ref>

All the request of my web app use the "defaultStack" I have defined in the 
struts.xml. (URL, $.ajax, $.getJSON, $.post, and etc....)

And another point is that JsonInterceptor has all the time the same value for 
the "accept" parameter. If I set the accept header in the ajax call it doesn't 
change in the interceptor. I think it's a regression from 2.3.x because now we 
can't only one interceptor-stack with interceptor-ref to json with contentType 
equals application/json. Now with accept = application/json all requests are 
read as they are json when you have only one interceptor-stack and it's the 
problem.

I don"t understand why the replacement of contentType in accept cause some 
troubles in my App... Why now it doesn't work ?

I must remove the interceptor-ref json to have my app working ... but if I do 
that all ajax request to get data from server and ajax request to post data to 
the server doesn't work anymore.

Another solution must be to implement two custom interceptor-stack but it cost 
to me to refactor all my struts action to use the new custom json stack to set 
accept param in the interceptor-ref json....

But I dont think that is the best way and I think other persons could have the 
same issue than me.

There is no way to have only one interceptor-stack to catch all request with 
various accept and contentType like in the 2.3.x Struts version ?

Please could you have a look about this very important issue it would be great.

Thank you very much




was (Author: walkn):
I have attached the version of my struts.xml when I am using Struts 2.3.28.

In the file you can see that I have defined in my "defaultStack" :
<interceptor-ref name="json">
        <param name="contentType">application/json</param>
</interceptor-ref>

All the request of my web app use the "defaultStack" I have defined in the 
struts.xml. (URL, $.ajax, $.getJSON, $.post, and etc....)

I don"t understand why the replacement of contentType in accept cause some 
troubles in my App... Why now it doesn't work ?

I must remove the interceptor-ref json to have my app working ... but if I do 
that all ajax request to get data from server and ajax request to post data to 
the server doesn't work anymore.

Another solution must be to implement two custom interceptor-stack but it cost 
to me to refactor all my struts action to use the new custom json stack to set 
accept param in the interceptor-ref json....

But I dont think that is the best way and I think other persons could have the 
same issue than me.

There is no way to have only one interceptor-stack to catch all request with 
various accept and contentType like in the 2.3.x Struts version ?

Please could you have a look about this very important issue it would be great.

Thank you very much



> No set parameter value to action
> --------------------------------
>
>                 Key: WW-4684
>                 URL: https://issues.apache.org/jira/browse/WW-4684
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.5.2
>         Environment: Windows
>            Reporter: COMBEAU
>             Fix For: 2.5.3
>
>         Attachments: ActionSample.java, login.jsp, screenshot-1.png, 
> struts-2.3.28.xml, struts.properties, struts.xml
>
>
> I have an issue on my webapp since I have update Struts 2 to version 2.5.2 
> from 2.3.28.
> When I post a form with parameters via ajax call, on the action class setters 
> are not called. All the time the setter and getter return "null" value
> I used Struts2-core and struts2-json-plugin



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to