0
Как включить проверку с помощью схемы с Jaxb2Marshaller? Пример Wiht ниже Если тег DateTime неверен (должен быть с T) 2015-09-09 T 16:56:39 "), я не получаю исключение, модель unmarshaller просто возвращает с нулевым значением.Проверка весны Jaxb2Marshaller не работает
schema: <xs:element name="ExecutionTime" minOccurs="0" maxOccurs="1"
type="xs:dateTime" />
tag example <ExecutionTime>2015-09-09 16:56:39</ExecutionTime>
Jaxb2Marshaller marshaller = null;
marshaller = new Jaxb2Marshaller();
marshaller.setContextPath(contextPath);
ClassPathResource schemaResource = new ClassPathResource(classpathXSD);
marshaller.setSchema(schemaResource);
marshaller.setMappedClass(Entity.class);
marshaller.unmarshal(stringSource)
Вы видели [эту ссылку] (http://stackoverflow.com/a/26176086/3364187)? Я думаю, полезно – Xstian
Да, но у меня нет ответа. Только повторяет, что спецификация схемы не заставляет Srping Jaxb2Marshaller проверять xml на схему. – magulla