Jakub Podlesak wrote:
> Hi Paul,
>
> please see in line...
>
> On Wed, Aug 01, 2007 at 03:27:23PM +0200, Paul Sandoz wrote:
>> Hi Jakub,
>>
>> Your patch looks like a good start. You have found all the relevant areas.
>>
>> Some suggested changes:
>>
>> - Refer to string constants using documented public static final
>> variables which are part of the API.
>
> Do you mean public static final variables of [com.sun.ws.rest.api.core.ResourceConfig] ?
Yes.
>> - For the string constants use a naming convention, for example:
>>
>> com.sun.ws.rest.feature.<name>
>
> Probably not, since otherwise the naming convention would be different:
>
> [com.sun.ws.rest.api.core.ResourceConfig.<name>Feature] or so
>
> Maybe I misunderstood?
>
It does not have to be the same as the full class name of
ResourceConfig. It could be:
static final String NORMALIZE_URI =
"com.sun.ws.rest.config.feature.NormalizeURI"
For example, look at the static final strings used as property names for
the following class:
javax.xml.ws.handler.MessageContext
>> - RedirectToCanonicalURI implies PreserveContSlashes. Perhaps we should
>> have the following:
>>
>> Redirect
>> If either the features NormalizeURI or CanonicalizeURIPath are true
>> and the application of normalization and/or canonicalization to the
>> request URI result in a new URI that is not equal to the request URI
>> then temporarily redirect the client to the new URI.
>
> i am not sure we need the redirect feature then, since
> redirect == (normalize || canonicalize)
>
The act of modifying the request URI is different from the act of
redirecting the client to the modified request URI. There might be cases
where one wants to normalize/canonicalize the URI on the server side
without redirecting the client.
>> NormalizeURI
>> Normalize the request URI as specified by URI.normalize().
>
> You mean as specified in *javadoc* for URI.normalize() ?
Yes.
> i.e. we can't use just URI.normalize() at the moment to compute it, right?
>
>> CanonicalizeURIPath
>> Canonicalize the path of the request URI by removing contiguous
>> '/' from the path.
>
> i.e. how URI.normalize() works at the time being?
>
Yes, but more accurately URI.normalize() implementation currently equals
normalize + canonicalize URI path.
Basically when all features are the default value we should have the
same behaviour as we have now.
Paul.
>
> Thanks,
>
> ~Jakub
>
>> (all default to true)
>>
>>
>> Jakub Podlesak wrote:
>>>> then we need to add relevant options to the APT tool and modify it to
>>>> generate the correct ResourceConfig code and modify the runtime
>>>> accordingly.
>>> I suggest to have following options:
>>>
>>> -Anoredir :
>>> no redirects to canonical URIs at all (however are they computed)
>>> -Apreserveslashes :
>>> whenever a request is redirected and whatever method is used
>>> to compute the canonical URI, multiple slashes must be preserved
>>>
>> IMHO I think we should have the APT options correspond exactly to the
>> features:
>>
>> -Aredirect
>>
>> -AnormalizeURI
>>
>> -AcanonicalizeURIPath
>>
>> that have the same defaults as the features, and support a boolean value
>> (from using Boolean.valueOf) the absence of which assumes true, for example:
>>
>> -Aredirect # value is true
>> -Aredirect=false
>> -Aredirect=true
>>
>>
>> You may want to consider creating a temporary branch and commit changes
>> to that (just in case you loose stuff locally), then when it is ready
>> merge with the trunk, and then delete the temp branch. IIRC this is a
>> common way of working with SVN.
>>
>> Paul.
>>
>> --
>> | ? + ? = To question
>> ----------------\
>> Paul Sandoz
>> x38109
>> +33-4-76188109
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>
--
| ? + ? = To question
----------------\
Paul Sandoz
x38109
+33-4-76188109