Hi all,

Consider sending a post request with a single parameter set to the empty
string, e.g. as in:

   $ curl -Fempty="" http://localhost:8888/content

This causes the property to not be set to the empty string. If the
property would exist, it would even be removed.

Now, consider sending two parameters of the same name set to the empty
string, e.g. as in:

   $ curl -Fempty="" -Fempty="" http://localhost:8888/content

Now, a multi-value property with two values being empty strings is created.

My question is: Is this desired behaviour ?

If so, how is it possible to set a property to an empty string using the
SlingPostServlet ?

Next steps: we have default value handling using the @DefaultValue
suffix, e.g. as in:

   $ curl -Fempty="" -fem...@defaultvalue="defautl" \
          http://localhost:8888/content

Setting the default value to some special value may be used to cause
empty properties to have "side-effects":

    :null --> remove the property if it exists, this is the same
        behaviour as if the @DefaultValue parameter would not be set
    :ignore --> set the property to the empty string if the
        property exists otherwise ignore the parameter

Now, I would assume, that sending an empty parameter should really set
the property to the empty string and wanting to remove a property should
the parameter not be set to a non-empty value must be requested with
@DefaultValue=:null.

WDYT ?

Regards
Felix

Reply via email to