Open source, commercial support.

Using the displayname field

Community provided content
Register
New page Edit

The DAV spec defines a "displayname" field which can contain any arbitrary text representing the name of a resource to the end user. This field doesnt form part of the url.

But most people usually want the displayname field to be the same as the resource name, ie Resource.getName(). This is what Milton does by default.

However, Milton allows you to change this behaviour by dependency injection.

The displayname property is determined by the injected instanceof DisplayNameFormatter, which gets injected into the WebDavProtocol class (see configuration). Two default implementations are provided:

  • DefaultDisplayNameFormatter: which just returns Resource.getName()
  • CdataDisplayNameFormatter: which wraps another DisplayNameFormatter and puts the content inside a CDATA element

As of the time of writing (13/7/2010) its not certain that the displayname field ever needs to be put inside a CDATA section, but Apache Slide appears to do so.