MediaType bean attributes

An MediaType is created using a Spring bean with the following attributes:

Attribute Value Description
id User-defined A unique ID for the bean.
parent io.mediaType.factory.abstract The parent bean.

MediaType bean properties

The MediaType bean takes the following properties:

Property Type Mandatory Description
name String Required The name to be used for the MediaType.
label String Required The label to be used for the MediaType.
parent MediaType Optional The MediaType parent.

MediaType example

<bean id="css.mediaType" parent="io.mediaType.factory.abstract">
  <property name="name" value="text/css" />
  <property name="label" value="CSS stylesheet" />
  <property name="parent" ref="text.mediaType" />


To debug your MediaType, add the following entry to your file: