I'm trying to set custom characterEscapeHandler for moxy jaxb but getting exception:

javax.xml.bind.PropertyException: name: com.sun.xml.bind.characterEscapeHandler value: ..

I do it (and it works for standart jaxb) by adding com.sun.xml.bind.characterEscapeHandler property to marshallerProperties of org.springframework.oxm.jaxb.Jaxb2Marshaller.

I know about XmlCdata. but i don't want !Cdata[[.. will be added, i just want don't escape characters (without adding Cdata).

有帮助吗?

解决方案

We are currently in the process of adding support for the JAXB RI's CharacterEscapeHandler to EclipseLink JAXB (MOXy). You can track our progress using the following bug:

You will be able to use either the RI property and CharacterEscapeHandler class, or the MOXy equivalent. This support will be checked in this week, and a nightly download of EclipseLink 2.4.0 will be available at:

I will update my answer once the feature has been checked in.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top