[ 
https://issues.apache.org/jira/browse/SLING-2534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416311#comment-13416311
 ] 

Carsten Ziegeler commented on SLING-2534:
-----------------------------------------

We can't force each and every user to change their existing clients - JCR 
handles empty string values which is correct from their pov; this is about the 
Sling Post Servlet where it has been decided in the beginning to treat empty 
values as non existing. Therefore the underlying property is removed from the 
repository. This is a pure design choice at that point of time.
Looking back, this decision might be wrong, but there are a lot of Sling users 
out there relying on this fact. In a lot of cases, for rendering content it 
doesn't make a difference if a property is not existing or empty. But I 
understand that there might be applications which treat this differently - 
which is totally fine.
One solution would be to add a configuration switch to the post servlet where 
the current default behaviour can be changed to treat empty strings as empty 
strings. However, this would be a global switch. Or we could add a special 
request parameter like :deleteEmptyStringIfBlank=false which you could use on 
your requests?

(Just a general comment, I think the post servlet is doing too much magic and 
maybe it's time to create a new post servlet)
                
> Strings of zero length on update in post servlet delete the property
> --------------------------------------------------------------------
>
>                 Key: SLING-2534
>                 URL: https://issues.apache.org/jira/browse/SLING-2534
>             Project: Sling
>          Issue Type: Bug
>          Components: Servlets
>    Affects Versions: Servlets Post 2.1.2
>            Reporter: Endolf
>         Attachments: blankstrings.patch
>
>
> According to JCR specs, for string type properties, a blank string should be 
> a valid value. Currently the post servlet delets any property where 1 or less 
> values are specifed and the 1 value has a 0 length. I think string properties 
> with a zero length should be blanked instead of deleted.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to