deanistanbul
New Member
I am using the spring framework 3.1 (with hibernate) and I am trying to produce an XML representation like:\[code\]<user><iduser>1</iduser><email>[email protected]</email><firstName>bob</firstName></user>\[/code\]from this java class:\[code\]\[code\]@Entitypublic class User { @GenericGenerator(name = "table-hilo-generator", strategy = "org.hibernate.id.IncrementGenerator") @GeneratedValue(generator = "table-hilo-generator") @Id @Column(name = "iduser", unique = true, nullable = false) private int iduser; @NotBlank @NotNull @NotEmpty @Length(max = EMAIL_MAX_SIZE) @Column(name = "email", nullable = false) private String email; @NotBlank @NotNull @NotEmpty @Length(max = FIRST_NAME_MAX_SIZE) @Column(name = "firstName", nullable = false) private String firstName;}\[/code\]\[/code\]my servlet-conf.xml contains this view in a ContentNegotiatingViewResolver:\[code\]<!-- XML View --><bean class="org.springframework.web.servlet.view.xml.MarshallingView"> <constructor-arg> <bean class="org.springframework.oxm.xstream.XStreamMarshaller"> <property name="aliases"> <map> <entry key="user123" value="http://stackoverflow.com/questions/14449619/com.....entities.User" /> </map> </property> </bean> </constructor-arg></bean>\[/code\]But I don't understand why the result is a strange xml with hundreds of elements such that:\[code\]<org.springframework.validation.BeanPropertyBindingResult><nestedPath/><nestedPathStack serialization="custom"><unserializable-parents/><vector><default><capacityIncrement>0</capacityIncrement><elementCount>0</elementCount><elementData><null/><null/><null/><null/><null/><null/><null/><null/><null/><null/></elementData></default></vector></nestedPathStack><objectName>user</objectName><messageCodesResolver class="org.springframework.validation.DefaultMessageCodesResolver"><prefix/>\[/code\]1-Probably, the marshaller is playing too much with the reflection, how can I obtain the expected result that I want?( 2-I am interested also in producing a XML file with a list of Users) How can I do that?