Hello,
I'm using Grizzly within Jersey, purely as a REST endpoint. The server
consumes and produces content only with mediatype application/json.
For most errors, I can make this happen by registering Jersy
ExceptionMappers with Jersey: they produce a
javax.ws.rs.core.Response, where I can control the mediatype of the
entity.
Some errors don't make it Jersey though, instead grizzly uses the
configured default
org.glassfish.grizzly.http.server.ErrorPageGenerator. An example is
when an incoming request exceeds the configured maxPostSize.
Unfortunately, the ErrorPageGenerator#generate() method requires me to
generate a "HTML representation of the error page". I'd like to return
a response with mediatype application/json. Is that possible?
Thanks for your help.
Regards,
Henning