users@jsr311.java.net

Re: Request.evaluateConditions(EntityTag)

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 18 Sep 2009 16:36:02 -0400

On Sep 18, 2009, at 3:39 PM, Sergey Beryozkin wrote:

> This is helpful, thanks.
>
> I'm still not quite sure though how would a user react to say 'null'.
> It might've been
>
> If-Match: something -> null
>
> or
>
> If-None-Match: something else -> null
>
>
> Perhaps the user would then check if it was If-Match that was set to
> 'something'... Or may be in a given web application a user always
> knows
> that a client can only send say If-Match ...
>
I don't think it really matters why the null came back, the meaning is
unambiguous: perform whatever actions the method involves. A non-null
tells the caller that the preconditions weren't met and that the
method should terminate.

Marc.

>
> -----Original Message-----
> From: Marc.Hadley_at_Sun.COM [mailto:Marc.Hadley_at_Sun.COM]
> Sent: 18 September 2009 18:20
> To: users_at_jsr311.dev.java.net
> Subject: Re: Request.evaluateConditions(EntityTag)
>
> On Sep 18, 2009, at 12:53 PM, Sergey Beryozkin wrote:
>>
>> Following my question about
>> Request.evaluatePreconditions() (thanks Marc for the answer) I'd
>> like to clarify how Request.evaluateConditions(EntityTag) (and
>> similarly with Date being the arg) should act.
>>
>> There could be
>>
>> If-Match : something
>> and
>> If-Non-Match : something
>>
>> Request.evaluateConditions(EntityTag) can detect that a user
>> provided value matches either that of If-Match or If-Non-Match.
>>
>> Should Request.evaluateConditions(EntityTag) return null if a
>> provided tag value matches either that of If-Match or If-Non-Match ?
>> Or null if it matches If-Match and not matches If-Non-Match ?
>>
>
> Request.evaluatePreconditions("something")
>
> If-Match: something -> null // if (functionValue matches headervalue)
> If-Match: somethingelse -> non-null
> If-None-Match: something -> non-null // if (functionValue doesn't
> match headervalue)
> If-None-Match: somethingelse -> null
>
> Its basically like an if statement with true returning null and false
> returning a Response.
>
> Marc.
>
>> thanks, Sergey
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
>> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>