get Error Message
Posted
by pAkY88
on Stack Overflow
See other posts from Stack Overflow
or by pAkY88
Published on 2010-05-27T21:39:21Z
Indexed on
2010/05/27
21:41 UTC
Read the original article
Hit count: 164
I have two servlet: first servlet is similar to a client and creates an HttpURLConnection to call the second servlet.
I would like send a special error, formatted like a JSON object, so I call sendError method in this way: response.sendError(code, "{json-object}")
But in the first servlet when I read error with getResponseMessage method I just get standard HTTP message and not my json object as a string.
How I can get my json string?
© Stack Overflow or respective owner