How to configure JAXB so it trims whitespaces by default

前端 未结 3 2082
遥遥无期
遥遥无期 2021-01-04 04:31

I would like to configure JAXB so that it trims whitespaces on all string fields

I saw the following answer : How to configure JAXB so it trims whitespaces when unma

3条回答
  •  有刺的猬
    2021-01-04 04:57

    To make the example of configuring XJC (in the answer provided by Lukas Eder) complete, i would like to add the following sample configuration which we need to add in maven's pom.xml

        
        .
        .
        
           responseSchema
           
              xjc
           
           generate-sources
           
              false
              ${project.basedir}/src/main/java
              com.foo.bar.domain.response
              ../resources/bindings.xjb
              ${project.basedir}/src/main/resources/wsdl/xsd
              response.xsd
              true
           
        
        .
        .
     
    

    We need to have the following content to be added in bindings.xjb.

    
        
    
    

提交回复
热议问题