title: How to pass the values in the row that i want to delete/edit to the action class from jsp in struts2 using display tag?
body: <p>I  want to create edit , delete link in display tag with struts2. This is my jsp code</p>
  
  <pre><code>&lt;%@ page contentType="text/html; charset=UTF-8"%&gt;
  &lt;%@ taglib prefix="s" uri="/struts-tags"%&gt;
  &lt;%@taglib uri="http://displaytag.sf.net" prefix="display" %&gt;
  &lt;html&gt;
  &lt;head&gt;
  
      &lt;title&gt;Contact Manager - display tag Example&lt;/title&gt;
      &lt;link href="css/style.css" rel="stylesheet" type="text/css" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;display:table  name="contactList" requestURI="" pagesize="10" export="true" cellpadding="1" uid="sr"  cellspacing="1" size="50"
      defaultorder="ascending" sort="list" style="width:850"
       id="row"&gt;
              &lt;display:column property="id" title="serial no" sortable="true"   /&gt;
              &lt;display:column property="lastName" title="TV Show" sortable="true"   /&gt;
              &lt;display:column property="firstName" title="User Name" sortable="true"  /&gt;
              &lt;display:column property="emailId" title="Email Id" sortable="true"  /&gt;
  
              &lt;display:column media="html"
      title="Delete"
      style="text-align:center"&gt;
      &lt;s:url id="deleteUrl" action="deleteLink"&gt;
      &lt;s:param name="id1" value="#attr.row.id" /&gt;
      &lt;/s:url&gt;
      &lt;s:a href="%{deleteUrl}"&gt;
           Delete
      &lt;/s:a&gt;
  &lt;/display:column&gt;
  
  &lt;display:column media="html"
  title="edit"
  style="text-align:center"&gt;
  &lt;a href="deleteLink?id=&lt;s:property value="id"/&gt;"&gt;edit&lt;/a&gt;
  &lt;/display:column&gt;
  
               &lt;display:setProperty name="export.excel.filename" value="ActorDetails.xls"/&gt;
              &lt;display:setProperty name="export.pdf.filename" value="ActorDetails.pdf"/&gt;
              &lt;display:setProperty name="export.pdf" value="true" /&gt;
          &lt;/display:table&gt;
  
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>this is my action class:</p>
  
  <pre><code>    package net.viralpatel.contact.view;
  
      import java.util.List;
  
      import net.viralpatel.contact.controller.ContactManager;
      import net.viralpatel.contact.model.Contact;
  
      import com.opensymphony.xwork2.ActionSupport;
  
  
      public class ContactAction extends ActionSupport implements ModelDriven&lt;Contact&gt;,Preparable {
  
          private static final long serialVersionUID = 9149826260758390091L;
  
          private Contact contact;
          private List&lt;Contact&gt; contactList;
  
  
          private ContactManager linkController;
  
          public ContactAction() {
              linkController = new ContactManager();
          }
  
  
  
          public String getRecords()
          {
              contactList =linkController.lSist();
  
              return SUCCESS;
          } 
  
          public String deleteRecord()
          {
             System.out.println(contact.getId());
  
              return SUCCESS;
          } 
  
          public Contact getContact() {
              return contact;
          }
  
          public List&lt;Contact&gt; getContactList() {
              return contactList;
          }
  
          public void setContact(Contact contact) {
              this.contact = contact;
          }
  
          public void setContactList(List&lt;Contact&gt; contactsList) {
              this.contactList = contactsList;
          }
  
  
  @Override
      public Contact getModel() {
  
          return contact;
      }
  
      @Override
      public void prepare() throws Exception {
          // TODO Auto-generated method stub
          contact = new Contact();
      }
      }
  </code></pre>
  
  <p>How do I get the values of the attributes in the row which I delete from the jsp page to the deleteRecord() method in the ContactAction class??
  HERE the statement</p>
  
  <pre><code>System.out.println("ID IS "+contact.getId());
  </code></pre>
  
  <p>gives an output: ID IS null</p>
  
  <p>Please suggest some solution.</p>
  
  <p>Thanks</p>
  
  <p>this is the Contact bean</p>
  
  <pre><code>package net.viralpatel.contact.model;
  
  import java.io.Serializable;
  import java.sql.Date;
  
  import javax.persistence.Column;
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.Id;
  import javax.persistence.Table;
  
  @Entity
  @Table(name="Contacts")
  public class Contact implements Serializable{
  
      private static final long serialVersionUID = -8767337896773261247L;
  
      private Long id;
      private String firstName;
      private String lastName;
      private String emailId;
      private String cellNo;
      private Date birthDate;
      private String website;
  
      private Date created;
  
      @Id
      @GeneratedValue
      @Column(name="id")
      public Long getId() {
          return id;
      }
      @Column(name="firstname")
      public String getFirstName() {
          return firstName;
      }
      @Column(name="lastname")
      public String getLastName() {
          return lastName;
      }
      @Column(name="email_id")
      public String getEmailId() {
          return emailId;
      }
      @Column(name="cell_no")
      public String getCellNo() {
          return cellNo;
      }
      @Column(name="birthdate")
      public Date getBirthDate() {
          return birthDate;
      }
      @Column(name="website")
      public String getWebsite() {
          return website;
      }
      @Column(name="created")
      public Date getCreated() {
          return created;
      }
      public void setId(Long id) {
          this.id = id;
      }
      public void setFirstName(String firstName) {
          this.firstName = firstName;
      }
      public void setLastName(String lastName) {
          this.lastName = lastName;
      }
      public void setEmailId(String emailId) {
          this.emailId = emailId;
      }
      public void setCellNo(String cellNo) {
          this.cellNo = cellNo;
      }
      public void setBirthDate(Date birthDate) {
          this.birthDate = birthDate;
      }
      public void setCreated(Date created) {
          this.created = created;
      }
      public void setWebsite(String website) {
          this.website = website;
      }
  }
  </code></pre>