You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "COMBEAU (JIRA)" <ji...@apache.org> on 2016/09/02 09:28:20 UTC

[jira] [Comment Edited] (WW-4684) No set parameter value to action

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

COMBEAU edited comment on WW-4684 at 9/2/16 9:27 AM:
-----------------------------------------------------

My JavaScript is like this :
var Segment = function(sgmt) {
            var _this = this;
            
            this.id = sgmt.id;
            this.name = sgmt.name;
            this.comment = sgmt.comment;
            this.display = sgmt.display;
            this.type = ko.observable(sgmt.type);
        };


var params = ko.mapping.toJSON({segments: _this.segments(), sendMail: _this.sendMail()});

                $.ajax({
                      url:'segmentsName/save.action',
                      type:"POST",
                      data:params,
                      contentType:"application/json; charset=utf-8",
                      dataType:"json",
                      success: function(data){
                             utils.loadingWidget.hide();
                             utils.notify(data.status, data.message, _this.load);
                      }
                });

And my Action contains :
private List<SegmentDTO> segments;
public List<SegmentDTO> getSegments() {
	return segments;
}

public void setSegments(List<SegmentDTO> segments) {
	this.segments = segments;
}

And my struts config file is in attachement



was (Author: walkn):
My JavaScript is like this :
var params = ko.mapping.toJSON({segments: _this.segments(), sendMail: _this.sendMail()});

                $.ajax({
                      url:'segmentsName/save.action',
                      type:"POST",
                      data:params,
                      contentType:"application/json; charset=utf-8",
                      dataType:"json",
                      success: function(data){
                             utils.loadingWidget.hide();
                             utils.notify(data.status, data.message, _this.load);
                      }
                });

And my Action contains :
private List<SegmentDTO> segments;
public List<SegmentDTO> getSegments() {
	return segments;
}

public void setSegments(List<SegmentDTO> segments) {
	this.segments = segments;
}

And my struts config file is in attachement


> 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: 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)