How to generate the correct sitemap namespace using JAXB and Spring @ResponseBody in controller?

落花浮王杯 提交于 2019-11-29 13:54:22

You can leverage the @XmlSchema annotation to specify elementFormDefault is qualified. This should help with your use case.

@XmlSchema(
    namespace = "http://www.sitemaps.org/schemas/sitemap/0.9",
    elementFormDefault = XmlNsForm.QUALIFIED)
package example;

import javax.xml.bind.annotation.XmlNsForm;
import javax.xml.bind.annotation.XmlSchema;

For More Information

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!