开发者

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

开发者 https://www.devze.com 2023-02-28 15:20 出处:网络
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 lo

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消