Re: JSR311: ResponseBuilder

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 02 Sep 2008 12:57:55 +0200

Stephan Koops wrote:
> Hi,
> Request.evaluatePreconditions(..) returns a ResponseBuilder, which
> contains the status 413 (Precondition failed), if the Preconditons
> doesn't match. If the request is is GET (or HEAD) it could also be 304
> (Not modified). Than the server MUST (says HTTP) contains also e.g.
> expires, Cache-Control and others (see

Does it really matter if such headers are added to 412 responses?


> In a resource method performing GET requests the developer must check,
> if the returned ResponseBuilder represents 413 or 304, and - if needed -
> add the shown headers. The current version of ResponseBuilder does not
> allow to check the status. So I propose to add a method
> ResponseBuilder.getStatus() returning the type Response.Status to check
> this.
> I also propose to add to the javadoc of
> Request.evaluatePreconditions(..), that the addition of some headers is
> required in the case of 304, with a link to
> And a small other point: We discussed about the question, if a
> RuntimeEnvironment is allowed to throw a subclass of
> WebApplicationException where the spec defines a WebApplicationExc. The
> answer to this question was "yes, why not?", but it is not defined in
> the spec now. We should also define, that a runtime environment MUST NOT
> use exception mapper for this sub classes, but only for WebAppExc. This
> is needed, because an app developer could give his own exception mapper
> for WebAppExc, which should handle the requests thrown by the runtime
> environment.
> Sorry, that I'm late with this, but that are only a small changes.
> best regards
> Stephan
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

| ? + ? = To question
    Paul Sandoz