dev@jsr311.java.net

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
> http://tools.ietf.org/html/rfc2616#section-10.3.5).
>

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

Paul.

> 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
> http://tools.ietf.org/html/rfc2616#section-10.3.5.
>
> 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: dev-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: dev-help_at_jsr311.dev.java.net
>

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109