wood burning stoves*
The moose likes XML and Related Technologies and the fly likes add, edit xml record using jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "add, edit xml record using jsp" Watch "add, edit xml record using jsp" New topic
Author

add, edit xml record using jsp

Edward Durai
Ranch Hand

Joined: Oct 09, 2004
Posts: 223
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>


Thank You<br />Edward
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Edward Durai
Ranch Hand

Joined: Oct 09, 2004
Posts: 223
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

Joined: Jan 10, 2002
Posts: 61413
    
  67

Ah, ok I've moved this to the XML forum.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
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

Joined: Jan 02, 2003
Posts: 40
Check out jaxb 2.0. It is very easy to read and write xml nodes without knowing xml.

Regards
Balaji


Regards, Balaji
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: add, edit xml record using jsp