Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2432

It should be easy to send data as JSON instead of form-encoded

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 5.4
    • None
    • tapestry-core
    • 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;
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            jkemnade Jochen Kemnade
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: