users@jsr311.java.net

Re: Request.evaluateConditions()

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 18 Sep 2009 11:35:40 -0400

On Sep 18, 2009, at 10:55 AM, Sergey Beryozkin wrote:
>
> JAX-RS 1.1 has introduced Request.evaluateConditions() [1]
>
> I don't understand how/when a user would want to use a no arg
> Request.evaluateConditions() thus I'm not sure how to implement it.
>
> For example the javadocs say : Note that both preconditions If-None-
> Match: * and If-None-Match: something will always be considered to
> have been met.
>
> Does it mean Request.evaluateConditions() is really meant to detect
> that If-None-Match: * or If-None-Match: something http header
> values ? As an alternative to using HttpHeaders.getRequestHeader ?

Correct, the idea was to support preconditions for resources that
don't yet exist where you don't have a last modified date or etag to
compare with.

>
> If not then why would a user use Request.evaluateConditions() ?
>
> Also when would Request.evaluateConditions() return a non-null
> Response ?

If the request contained an "If-Match: something" then it would return
a non-null response since the precondition wouldn't be met.

Marc.

>
> thanks, Sergey
>
> [1] https://jsr311.dev.java.net/nonav/releases/1.1/javax/ws/rs/core/Request.html
>
>