Spring Jaxb2Marshaller 不调用 CharacterEscapeHandler
Spring Jaxb2Marshaller not call CharacterEscapeHandler
我尽力弄明白了,但失败了。 Spring Jaxb2Marshaller 似乎忽略了 CharacterEscapeHandler ! :-(
这是我的代码:
<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");
}
}
真的很累:-(
这是 Spring 集成 Jaxb2Marshaller 错误!
我尽力弄明白了,但失败了。 Spring Jaxb2Marshaller 似乎忽略了 CharacterEscapeHandler ! :-(
这是我的代码:
<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");
}
} 真的很累:-(
这是 Spring 集成 Jaxb2Marshaller 错误!