java - how to delete a blob in .jsp -


i trying delete image blob app through .jsp file, far i've got this:

<% blobstring=key.getproperty("keys").tostring(); //vale "keys" blob-key datastore, above code loops through pictures , gets key of them blobkey blobkey = new blobkey(blobstring); %>      <form action="<%=blobstoreservice.delete(blobkey)%>" method="post" enctype="multipart/form-data">     <input type="submit" value="delete" name="delete">      </form> 

i cant work , beginner in area, can spot im droing wrong?

you have create handler on server, example, /delete, process delete requests when user submits such request.

<form action="/delete" method="post" enctype="multipart/form-data"> <input type="submit" value="<% blobstring %>" name="delete">  

you cannot set object blobkey value in html code. accepts string.

this code goes inside /delete handler:

blobstoreservice.delete(new blobkey(blobstring)); 

note create blobstring need call

string blobstring = key.getkeystring(); 

method, not .tostring() trying use.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -