jsp跳转:
<input type="button" οnclick="window.parent.location.href='repay?id=${dvd.iD}'" value="归还"/>
Jsp中取action的map对象的值:
① 根据Id
Action: Map<String,Object> session =
ActionContext.getContext().getSession();
Emp em = service.getByEmpId(emp.getEmpno());
session.put("updateInfo", em);
Jsp : 编号:<input type="text" name="emp.empno" readonly="readonly"
value= "<s:property value="#session.updateInfo.empno" />"/>
②查询全部
Action: Map<String,Object> session =
ActionContext.getContext().getSession();
List<Emp> emplist = service.listAllEmp();
session.put("emplist", emplist);
Jsp: <s:iterator value="%{#session.emplist}" var="emp">
<tr>
<td><s:property value="#emp.empno" /></td>
</tr>
</s:iterator>
③查询全部并且放入下拉列表中
Action: List<Dept> deptlist = deptservice.listDept();
session.put("deptlist", deptlist);
Jsp: <s:select label="部门" list="#session.deptlist"
id="listdept" listKey="id" listValue="deptname" headerKey="0" headerValue="查询全部">
</s:select>
<!--EndFragment-->