dev@jersey.java.net

Re: ResourceConfig.PROPERTY_RESOURCE_PATHS

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 06 Nov 2007 16:50:52 +0100

Frank Martínez wrote:
>> It might be tricky since the path separator is different on different
>> OSes. Is using the separator ';' for the servlet init-param a
>> restriction when deploying on the Windows platform?
>>
>
> There is no problem with the current implementation of
> ServletContainer because of:
> String[] rels = resourcePathsParam.split(";");
>

Sorry i got mixed up, i meant the UNIX platform where developers are
familiar with ':'. It is kind of strange using the Windows path
separator ';' with the UNIX path segment separator '/' :-)

I am presuming that for servlet that '/' is the right thing to use (see
below) e.g. ServletContext.getRealPath depends on '/' being the path
segment separator.

Further more the servlet paths should never be absolute and reference a
drive.


>> Perhaps we can learn from Ant [1]:
>>
>> "You can specify PATH- and CLASSPATH-type references using both ":" and
>> ";" as separator characters. Ant will convert the separator to the
>> correct character of the current operating system."
>>
>> Should we use this approach?
>>
>> Paul.
>>
>
> What happen in this case: C:\xxxx:d:\yyy ?
> The expected behavior is to split into C:\xxxx and d:\yyy but there is
> a conflict with ':' separator.
>

Hmm... there seems to be an issue of path segment separators as well.

Looks like Ant scripts accepts both '/' and '\' for path segment separators.


> Maybe we can use always ';' separator. I works as well in Linux as in
> Windows because the split is done in our code. Not by the OS.
>

Perhaps i am over complicating matters. I have been trying to think of a
unified solution but nothing seems to work out well. So just leaving
things as they are and explicitly documenting servlet init-param options
seems the easiest and best way for now. Let's revisit when we have got
more use and feedback out if it.

Paul.

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