1.新增模板,新增模板数据集,新增文件数据集
具体详情参考我前面的博客:https://blog.csdn.net/bird_tp/article/details/86483076
下面进行java代码的工作
1.controller中写好读取实体类列表数据的接口,需注意的是,接口返回的必须是实体类,

public static ResponseEntity<String> getXmlEnitity(List< ? > list) {
HttpHeaders responseHeaders = new HttpHeaders();
responseHeaders.add("Content-Type", "application/xml; charset=utf-8");
String text = listToDatasetXml(list);
return new ResponseEntity<String>(text, responseHeaders,
HttpStatus.CREATED);
}
public static <T> String listToDatasetXml(List<T> rows) {
XStream xstream = new XStream(new DomDriver("UTF-8"));
if (rows == null) {
rows = new ArrayList<T>();
}
if (!rows.isEmpty()) {
x


3万+

被折叠的 条评论
为什么被折叠?



