Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML,dom

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help me out in solving below problem.
I have a jsp page which runs on apache with tomcat.
In this page I have around 20 text boxes of which some are editable, values for this text boxes will come from an xml document not from the database.
Now the problem is, when the user edits valus in text boxes and submits it. The updated values should get updated in xml document automatically.
Please let me know how can I do this, If you have any code examples please let me know.
It is very urgent
Thank you in advance
 
Guillaume Compagnon
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
*First at all, be familiar with good design, and learn the MVC model pattern (have a look to another thread, I'he put some links somewhere in a post)
1*In the controler , U will have to populate a model java bean with all the text fields contents.
2* You have 2 choices : simply make some
System.out.println("<field num='1'>"+request.getParameter("HTMLfield")+"</field>");
* Or use DOM or lightier JDOM to create an Object graph and dump it into XML
the best solutions will be using Java API for XML/Java Binding (JAXB) but it will be available in JDK1.4.
have a look to http://java.sun.com/xml
 
Guillaume Compagnon
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if U want to use JDOM , have a look to http://www.jdom.org
You ve got the book written by Brett Mc Laughin , the founder of JDOM , published by O'Reilly and called Java & XML
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Guillaume Compagnon:
*First at all, be familiar with good design, and learn the MVC model pattern (have a look to another thread, I'he put some links somewhere in a post)
1*In the controler , U will have to populate a model java bean with all the text fields contents.
2* You have 2 choices : simply make some
System.out.println("<field num='1'>"+request.getParameter("HTMLfield")+"</field>");
* Or use DOM or lightier JDOM to create an Object graph and dump it into XML
the best solutions will be using Java API for XML/Java Binding (JAXB) but it will be available in JDK1.4.
have a look to http://java.sun.com/xml

Can I use MS-DOM parser instead of Jdom
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic