0

I have used given in http://jeungun.wordpress.com/2009/09/18/binding-to-dynamically-generated-form-elements-in-spring-mvc/,

i am converting that output to xml using jaxb, Since the above example returns array list, the output is coming like below,

<item>
   <label>key1</label>
   <output>value1</output>
</item>
  <item>
   <label>key2</label>
   <output>value2</output>
</item>

but i want an output like below,

<item>
     <key1>value1</key1>
     <key2>value2</key2>
</item>

How to acheive this using jaxb?

I have used the belowcode:

 public class item {
    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getOutput() {
        return output;
    }

    public void setOutput(String output) {
        this.output= output;
    }

    private String label;
    private String output;

}
ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239

1 Answers1

0

It does the job for me...HurrAAAAAAAAAAAAYYYyYy

http://java.dzone.com/articles/mapping-arbitrary-list-objects