我的视图页面中有 dynatree,我想在每次拖放操作时保存树的当前状态,问题是我无法将该 dict 对象传递给控制器。ajax的代码如下:
onDrop: function(node, sourceNode, hitMode, ui, draggable) {
/** This function MUST be defined to enable dropping of items on
* the tree.
*/
logMsg("tree.onDrop(%o, %o, %s)", node, sourceNode, hitMode);
sourceNode.move(node, hitMode);
//save state to backend
var currentTree = $("#tree").dynatree("getTree").toDict();
$.post("/Application.java", { recieved: currentTree},
function(data) {
$("#output").html(data);
});
//expand the drop target
sourceNode.expand(true);
},
我在java中编写了一个获取该字典对象的方法。但是它在路由文件中给了我错误。错误:未找到:在此行中键入 Dictionary
POST /hello/:dict controllers.Application.check(dict:Dictionary)