views:

289

answers:

1

I'm trying to get inputStream from request, but it's always empty. Any idea how to get the contents of it? I'm trying to make a DataInputStream from it.

+1  A: 

Are you uploading multipart requests? The request may have already been processed into a Spring MultipartRequest by Grails in which case you can use getFile() to get the upload contents.

If not, then request.inputStream should work fine.

cheers

Lee

leebutts
No, I'm not doing multipart. The weird thing is, I created a servlet and register it in web.xml (grails install-templates), but its request.getInputStream() is empty too. Being curious, I extracted that very same servlet into a new ordinary Java Web (Eclipse New Project), and it works. Any idea why?
wiradikusuma
No idea, that sounds very strange. Can you reproduce it with a brand new Grails app? If so, I'd create a JIRA bug report and attach the example project.
leebutts