• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in deleting the file

 
madhuri kunchala
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
in my project...i need to do delete operation..i developed one XML file...when i do delete..it is deleting the whole information in the xml file....what ever value i enter in the jsp page it should take that value and do delete operation...for deleting i wrote servlet coding...here is my code...can anyone help me where i wrote wrong...

delete.java



thanks,
madhu.
 
madhuri kunchala
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone help me im waiting for the reply..where my code goes wrong..
 
Prasad Krishnegowda
Ranch Hand
Posts: 670
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Madhu,

Just comment out this

and change this line

to

in delNode function...
 
madhuri kunchala
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
thanks for your reply..i tried it is deleting only one line...in my xml file i need to delete whatever pack name entered...it should delete..here im attaching my xml file..if you see my xml file you'll see <MA98>,<MA99>,<MA03>..i need to delete <MA03> means that file should not be there..can you tell me where to do

 
madhuri kunchala
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my xml file



 
madhuri kunchala
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
prasad have you seen my xml file and suggest me how to do for deletion of 'Pack 1 or other packs'...
 
Prasad Krishnegowda
Ranch Hand
Posts: 670
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For that, You need to have a for loop inside if (child.getNodeName().equals(filter)) and get all its child elements one by one and delete them...
 
madhuri kunchala
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kk..i'll try i had another doubt..is i had done modification..but the modification is happening at the end of my xml file...but i need is i used to enter the 'Pack Name' in jsp page..by taking that 'Pack Name' it should check and it should do modification at that pack place...i had used for loop..but im unable to get it...here is my code..for modification

modify.java



can you check it and provide me where to do changes..
 
madhuri kunchala
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
prasad have you got my problem
 
Prasad Krishnegowda
Ranch Hand
Posts: 670
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya.. I have got what your problem is, but please be limited to one problem in a topic and for every other problem, create a new topic for new discussions, so that, you may get other ranchers responses also...
 
madhuri kunchala
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
k
 
Sridhar Gudipalli
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Sorry but my response is not related to your problem. But I was wondering why this method signature is like this? I mean bunch of parameters? Why dont you have a single or some less number of objects which contains these parameters? You are forcing method users to type all the parameters (I know now its private method)?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic