spring mvc 返回xml 根据 contenttype

源:http://www.233.com/ncre2/JAVA/jichu/20100823/082002104-3.html
评:
1.异常   Exception in thread "main" com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException:
  2 counts of IllegalAnnotationExceptions

解决:  @XmlTransient

  public String getName() {

  return name;

  }

  public void setName(String name) {

  this.name = name;

  }

  }

   注意要把@XmlTransient放在get()方法前面,否则可能会出现导致运行报错:

你可能感兴趣的:(spring mvc)