在action里接收到你的参数后,放进map里,再以参数形式传递进service层有什么问题吗?
比如
//service interface
void receiveData(Mapmap);
//service impl
public void receiveData(Mapmap) {
System.out.print(map.get("msg"));
}
//action
private Dao dao;
public void sayHello() {
String msg = ServletActionContext.getParameter("msg");
Mapmap = new HashMap ();
map.put("msg", msg);
dao.receiveDate(map);
}
//ajax
$.post("/zhidao/answer.htm",{"msg" : "hello"},function(){});