title: How to return JSON in a file upload operation
body: <p>I am uploading a file and everything uploads fine. I want to return a JSON object with the primary key defined, so I do this:</p>
  
  <p>ec.web.sendJsonResponse( "{offerId: '${offer.offerId}'}")</p>
  
  <p>which packages things the way my javascript receiving code expects (because it is a file upload op), but it wraps in like this:</p>
  
  <pre><code>    &lt;html&gt;
      &lt;head&gt;&lt;/head&gt;
      &lt;body&gt;
      &lt;pre style="word-wrap: break-word; white-space: pre-wrap;"&gt;
          &lt;textarea&gt;{offerId: '100030'}&lt;/textarea&gt;&lt;/pre&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>and the "pre" tag keeps my "getElementsByTagName" from finding the "textarea" element.</p>
  
  <p>I know that WebResource.sendJsonResponse is not adding it. It is setting the contentType to json and the receiving code is complaining because it is expecting a DOM object (error> Resource interpreted as Document but transferred with MIME type application/json:)</p>
  
  <p>How do I resolve this? I guess this is really a J2EE question, but it might happen to someone else in moqui.</p>