简体   繁体   中英

Spring Jaxb2Marshaller not call CharacterEscapeHandler

I tried my best to figure it out, but failed. The Spring Jaxb2Marshaller seem ignored CharacterEscapeHandler ! :-(

Here is my code:

<bean id="aisWsMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
    <property name="contextPath" value="com.capgemini.manulife.integration.generated.ais.ws.oneshot"/>
    <property name="marshallerProperties">
        <map>
            <entry key="com.sun.xml.bind.characterEscapeHandler" value-ref="noEscapeCharacterHandler">
            </entry>
        </map>
    </property>
</bean>

<bean id="noEscapeCharacterHandler" class="com.capgemini.manulife.integration.NoEscapeCharacterHandler">

</bean>


public class NoEscapeCharacterHandler implements CharacterEscapeHandler {

@Override
public void escape(char[] ch, int start, int length, boolean isAttVal, Writer out) throws IOException {
     out.write(ch, start, length);
    System.out.println("AAAA");
}

} Really tired :-(

这是Spring Integration Jaxb2Marshaller错误!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM