Link to home
Start Free TrialLog in
Avatar of karthickkrishnan
karthickkrishnanFlag for India

asked on

XML manipulation in struts

In my struts Application,  From my Action class, I call the manager class and the manager class calls the  DAO calls which would query the DB to fetch the results . Now the requirement is, i need to construct the results in the form of an XML and send it back to my Action class as a " String " . In my action class I need to parse the XML and and get the individual items in the XML

My XML format should be  something like this
<Name> karthick <./Name>
<passwrod> xxxx </password>
<url>https://www.experts-exchange.com</url>

Please advice



Avatar of krishna kishore mellacheruvu venkata
krishna kishore mellacheruvu venkata
Flag of India image

Use Java xml binding for the above scenario. first prepare xsd for the above xml. Through jaxb you can generate POJO for the above xml. from db populate the values in the generated POJO. Then convert POJO to XML in the DAO and send to action class. And then in action class convert again the XML to pojo and access the individual items.
ASKER CERTIFIED SOLUTION
Avatar of krishna kishore mellacheruvu venkata
krishna kishore mellacheruvu venkata
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial