• 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

creating XML from Beans

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i want to know if the following is possible using EJB and XML.
using HTML/javascript, a form has been created. now the user makes selections using the form. i want to create a XML file that encapsulates the user selections ie this XML file should contain the selections made by the user. this XML file should also automatically change whenever the user makes new selections on the HTML form.
someone suggested me that Beans are the best option to use. can u guide me on how to proceed using Beans.
thanks in advance.
 
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whenever user select something and submit the request. You just call the bean to write that selection in XML File. You can use DOM or JDOM to create the XML File using java beans.
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why do you think that using XML is the best option? Where do you plan on storing these files? Have you thought of just entering this information in a database instead (which is the more common and easier solution).
Java is an Object-oriented language. Objects are almost ALWAYS easier to use and faster than XML when you're not using XML as a program-to-program communication mechanism. Just create objects to hold the selections -- if they need to persist over a long time, then store the objects in a database (you should look into a commercial or free object-to-relational mapping tool like Hibernate -- the folks in the Object-to-Relational forum always have opinions on things like this).
Kyle
reply
    Bookmark Topic Watch Topic
  • New Topic