struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Burton Rhodes <burtonrho...@gmail.com>
Subject How to set a List<Integer> using JSON plugin?
Date Sat, 04 Jun 2011 15:20:32 GMT
I am trying to do something incredibly simple and for some reason I
cannot get the JSON plugin to work.  Below are a few code snippits.
Can any tell me why I get an error when trying to set a List<Integer>
when using the JSON plugin?  Do I need a converter for this?  Or am I
missing somthing simple?

// Test Submit - This correctly sets 'xactionId'
$.ajax({
  url: "json/TaskBatchJson_saveNewTasks.action",
  data: { 'xactionId': 1 },
  success: function(data){
    alert("Success.");
  }
});

// Test Submit - This gives me an error (below)
$.ajax({
  url: "json/TaskBatchJson_saveNewTasks.action",
  data: { 'ignoreTaskIds': [1,2] },
  success: function(data){
    alert("Success.");
  }
});


** Error When Trying to Set "ignoreTaskIds"
WARN : Error setting expression 'ignoreTaskIds[]' with value
'[Ljava.lang.String;@19e9da7'
ognl.ExpressionSyntaxException: Malformed OGNL expression:
ignoreTaskIds[] [ognl.ParseException: Encountered " "]" "] "" at line
1, column 15.


My Action includes the following:

private int xactionId;
private List<Integer> ignoreTaskIds;

public int getXactionId() {
	return xactionId;
}
public void setXactionId(int xactionId) {
	this.xactionId = xactionId;
}
public List<Integer> getIgnoreTaskIds() {
	return ignoreTaskIds;
}
public void setIgnoreTaskIds(List<Integer> ignoreTaskIds) {
	this.ignoreTaskIds = ignoreTaskIds;
}

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message