Use the action field to set the parameter id
:
public class StudentAction extends ActionSupport {
private List studentList;
Student student;
StudentDAO sdo = new StudentDAO();
private Long id;
//getter and setter
public String delete() {
System.out.println("delete action");
System.out.println(getId());
sdo.delete(getId());
return SUCCESS;
}
}
One more thing if you want to implement ModelDriven
you should add the code for your model
private Student model = new Student();
public Object getModel() {
return model;
}
The code is like in the documentation example.