Details
-
Wish
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
5.4
-
None
-
None
Description
When data is sent from the client to the server via t5/core/ajax the data is transferred as application/x-www-form-urlencoded content.
OnEventWorker and @RequestParameter are tailored to that transfer method.
Sometimes it is more appropriate to send data as application/json, but if you do that, if I'm not missing something, things are much more complicated on the server side: You have to @Inject the HttpServletRequest, acquire a ServletInputStream, read that into a String, have that parsed into a JSONObject and retrieve the data from that. You also have to do all the error-handling yourself.
Tapestry should be able do some of that for you.
Maybe we can start by allowing for something like
@Inject
@RequestBody
private JSONObject requestJson;