Solved

XML manipulation in struts

Posted on 2008-06-17
2
261 Views
Last Modified: 2013-11-24
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>www.experts-exchange.com</url>

Please advice



0
Comment
Question by:karthickkrishnan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 10
ID: 21802010
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.
0
 
LVL 10

Accepted Solution

by:
krishna kishore mellacheruvu venkata earned 200 total points
ID: 21810556
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question