We have the following Ajax call in our JSP as follows:
$.postJSON("${sendStatus}", command,
getData(data),
{ error: onError }
);
And the method in our controller looks like:
@ActionMapping(params = "action=/status")
public @ResponseBody
Status sendMessage(@RequestParam("command") final MyCommand command) {
logger.info("sending message");
final Status status = sender.sendMessage(
MyCommand.getProperties(), command.getMessage());
return status;
}
This worked find in our original Servlet version. And then we deployed it into Liferay with a little work on the JSP to let Liferay know what the URL to post to is. But when we run it, the "command" object is null.
We see the "sending message" log statement, and we verified there are no are no JavaScript errors via FireBug. So Liferay is posting it to the right URL, and the controller is running, but the "command" parameter is not set.
Any ideas what is happenening?