Friday 15 February 2013

java - Struts2 CRUD Delete not Working -



java - Struts2 CRUD Delete not Working -

i trying delete selected row in project i'm using hibernate , struts.

<a href="deletepublication?id=<s:property value="id"/>"><img src="${pagecontext.request.contextpath}/img/delete.png" width=20px height=20px></a>

this link want click! in struts.xml action defined as:

<action name="deletepublication" class="de.nak.library.action.publicationaction" method="delete"> <result type="redirect">showpublicationlist.action</result> <result type="chain" name="input">showpublicationlist</result> </action>

the action class looks like:

public string delete() { publication = publicationservice.loadpublication(publicationid); if (publication != null) { publicationservice.deletepublication(publication); } homecoming success;

if click link, nil happening! tried set breakpoint in delete method, , saw not called. please help!

change in struts.xml:

<constant name="struts.devmode" value="true" />

this turn on developer mode can see more log messages on console. might not have getter , setter properties. missing " in attributes.

<s:a namespace="onthepackage" action="deletepublication"><s:param name="id" value="%{id}"/><img src="<s:url value='/img/delete.png'/>" width="20px" height="20px"> </s:a>

java hibernate struts2 struts crud

No comments:

Post a Comment