Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

add, edit xml record using jsp

 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have one jsp page contains
4 check boxes like create, view, update and search. if i check selected fields should be stored in below format.

And if i want to edit the field, i want to edit the field. How? pls send yours suggestions

Thanks

<FIELD_LIST>
<FIELD F_ID="0" Create="0" View="1" Update="0" Search="1"/>
</FIELD_LIST>
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64971
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simply submit the form in the JSP to a servlet that gathers the request parameters and creates the XML snippet.

I'm not sure what the issue here is, it's a pretty straight-forward operation.
 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can Create xml. But How can I edit the xml. Any need to use xml parser?
give me some samples. Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64971
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, ok I've moved this to the XML forum.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I edit the xml. Any need to use xml parser?

Yes, you will need to have the XML to be edited in memory as a DOM if you want to change the values and/or structure. This can get pretty tricky due to the characters that have special meaning in HTML pages and XML documents.

I think we have had related discussions here before, you might search the archives. My suggestion is that you first get really comfortable with reading in an XML document, modifying it and writing it back out in a desktop utility to avoid all the extra complexity of JSP. When you have that worked out move to JSP/servlets.
Bill
 
Jeya Balaji
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out jaxb 2.0. It is very easy to read and write xml nodes without knowing xml.

Regards
Balaji
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic