xmljsfentitiesmojarra

JSF 2 Mojarra -- Can I configure the app to always use numbered XML entities instead of named entities?


I'm noticing that mojarra outputs named html entities in many cases as opposed to numbered entities. This seems to cause issues when using an application/xhtml+xml content type. I looked through some mojarra configuration options but wasn't able to find a way to configure the application to always use numbered entities. Is this possible?


Solution

  • The standard renderkit of JSF is designed to output (X)HTML, not XML. You need to supply a 3rd party renderkit or to create a custom renderkit which outputs XML. No 3rd party ones comes to mind however.

    Apart from that, if you intend to return XML upon a web request, then JSF is not really the right tool for the job. Better head to JAX-WS or JAX-RS.

    By the way, the right XML content type is not application+xml but application/xml.