Disable validation for jaxb 1 marshaller -


how disable validation on marshaller jaxb1?

you set validationeventhandler on marshaller ignored events:

marshaller.seteventhandler(new ignoringvalidationeventhandler()); 

the validationeventhandler like:

import javax.xml.bind.validationevent; import javax.xml.bind.validationeventhandler;  public class ignoringvalidationeventhandler implements validationeventhandler {      public boolean handleevent(validationevent event) {         return true;     }  } 

note: if new application recommend using jaxb 2 (jsr-222) instead of jaxb 1.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -