You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Joe Shelby <jw...@javaclientcookbook.net> on 2008/01/29 22:35:27 UTC

[Configuration] 1.1 to 1.4 upgrade - commas producing a list?

In our config files, we have LDAP URLs (among other values) that had  
commas in them.  "ldap://serverhost/DC=domain,DC=com".  With config  
1.1, this worked perfectly well; getString() returned the full value  
exactly as in the XML file.

I ran into an issue that made no sense with config 1.4 - I only get up  
to "DC=domain" - the ",DC=com" disappeared from getString().

When I did a dump of the config properties, I saw that the URI had  
gotten converted to a list of 2 strings, and getString() silently only  
returned the first one (as documented).  I have yet to find any  
documentation on this change nor on how to avoid it.

This is not what I want.  I can create a list by creating multiple  
values each in their own tags just fine without this trying to "help"  
me. :)  How can I restore the original behaviour and/or "escape" the  
comma to keep it from generating a list and leave the string intact?

thanks,
Joe



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


RE: [Configuration] 1.1 to 1.4 upgrade - commas producing a list?

Posted by MERLIN Bertrand <be...@laposte.fr>.
But you can't use anymore the list fonctionnality ...

Another way is to escape your commas, like this :
"ldap://serverhost/DC=domain\,DC=com"

bertrand

-----Message d'origine-----
De : Bond - James D. [mailto:james007@telesoft.com]
Envoye : mercredi 30 janvier 2008 01:10
A : Jakarta Commons Users List
Objet : Re: [Configuration] 1.1 to 1.4 upgrade - commas producing a
list?



You have to tell the Configuration class what to use as the 'delimiter'.
With XMLConfiguration, I always have this in the startup of my class (so
that I have no delimiting):

XMLConfiguration.setDelimiter('~');

> In our config files, we have LDAP URLs (among other values) that had
> commas in them.  "ldap://serverhost/DC=domain,DC=com".  With config
> 1.1, this worked perfectly well; getString() returned the full value
> exactly as in the XML file.
>
> I ran into an issue that made no sense with config 1.4 - I only get up
> to "DC=domain" - the ",DC=com" disappeared from getString().
>
> When I did a dump of the config properties, I saw that the URI had
> gotten converted to a list of 2 strings, and getString() silently only
> returned the first one (as documented).  I have yet to find any
> documentation on this change nor on how to avoid it.
>
> This is not what I want.  I can create a list by creating multiple
> values each in their own tags just fine without this trying to "help"
> me. :)  How can I restore the original behaviour and/or "escape" the
> comma to keep it from generating a list and leave the string intact?
>
> thanks,
> Joe
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>

--
James Dalrymple
Telesoft Corp.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Configuration] 1.1 to 1.4 upgrade - commas producing a list?

Posted by "Bond - James D." <ja...@telesoft.com>.
You have to tell the Configuration class what to use as the 'delimiter'.  
With XMLConfiguration, I always have this in the startup of my class (so 
that I have no delimiting):

XMLConfiguration.setDelimiter('~');

> In our config files, we have LDAP URLs (among other values) that had  
> commas in them.  "ldap://serverhost/DC=domain,DC=com".  With config  
> 1.1, this worked perfectly well; getString() returned the full value  
> exactly as in the XML file.
> 
> I ran into an issue that made no sense with config 1.4 - I only get up  
> to "DC=domain" - the ",DC=com" disappeared from getString().
> 
> When I did a dump of the config properties, I saw that the URI had  
> gotten converted to a list of 2 strings, and getString() silently only  
> returned the first one (as documented).  I have yet to find any  
> documentation on this change nor on how to avoid it.
> 
> This is not what I want.  I can create a list by creating multiple  
> values each in their own tags just fine without this trying to "help"  
> me. :)  How can I restore the original behaviour and/or "escape" the  
> comma to keep it from generating a list and leave the string intact?
> 
> thanks,
> Joe
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 

-- 
James Dalrymple
Telesoft Corp.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org