Hello, friends! Please tell me in the next question. I work with Struts2
There is an Action that processes requests.
public class ComputerAction extends ActionSupport { private List<CompBean> ComputerList; // Хранит список всех компьютеров private String id;// Запоминает ID текущего компьютера @Override public String execute() throws Exception { HibernateComputerDao daoC = new HibernateComputerDao(); ComputerList = daoC.loadAllComputer(); return SUCCESS; } // get/set metgods }
And there is also a JSP page that lists all computers.
<s:iterator value="ComputerList" status="status" > <tr> <td> <s:property value="id"/> </td> <s:form action="computer" method="POST"> **<s:hidden name="id" value="#ComputerList.id" />** <s:submit method="deleteComputer" class="link" value="Удалить"></s:submit> </s:form> </td> </tr> </s:iterator>
<s:hidden name="id" value="#ComputerList.id" />
in the id variable, I want to put the value #ComputerList.id
, but nothing comes out. Tell me what to do.