Hi Aron,
AFAIK the Servlet API do not support the setting of a text like "Bad
Request"; it ever using it's default text for the given code. I can't
say what happens with "Your exception message goes here" in a Servlet
application.
best regards
Stephan
Aron Roberts schrieb:
During my first look at the new ResourceException in 1.1RC2, after
Jerome added it nearly a year ago :-), it appeared that the values
returned by its getMessage() method seemed to always be prefixed by
the status description and code.
A representative example:
Bad Request (400) - Your exception message goes here
Since those values ("Bad Request" and "400") are likely to also be
individually accessible from the ResourceException - although I
haven't yet tried this - via:
ResourceException.getStatus().getCode()
ResourceException.getStatus().getName()
ResourceException.getStatus().toString()
and it should therefore be convenient to construct a message with
those values, if wanted, my thought is that
ResourceException.getMessage() should solely return the underlying or
user-provided exception message, without being prefixed by the status
description or code. That would increase the number of situations
where this message could be used 'as is', without needing to remove
the prefix.
Since I may be missing something obvious here, I'd welcome thoughts
from Jerome and the list ...
Aron