ciao andbin!
allora, modificando così funziona:
però il file mi esce così:codice:@XmlRootElement(name = "books") public class ListBooks { ArrayList<BookModel> bookList; public void setBookList(ArrayList<BookModel> bookList) { this.bookList = bookList; } public ArrayList<BookModel> getBookList() { return bookList; } }
vorrei però mettere <book> al posto di <bookList>.codice:<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <books> <bookList> <author>arthur c. clarke</author> <editor>longanesi</editor> <id>87</id> <isbn></isbn> <note></note> <price>0.0</price> <title>2001 odissea nello spazio</title> </bookList> ....... </books>
ho provato rimetterendo XmlElementWrapper con un name diverso, ma ottengo lo stesso errore:
come posso fare??codice:@XmlRootElement(name = "books") public class ListBooks { @XmlElementWrapper(name = "book") ArrayList<BookModel> bookList; public void setBookList(ArrayList<BookModel> bookList) { this.bookList = bookList; } public ArrayList<BookModel> getBookList() { return bookList; } }

Rispondi quotando