• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XML,dom

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Morning came much too soon and it brought along a friend named Margarita Hangover, and a tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic