我正在尝试重定向一些动态的动作,以便动态地将动态从动作重定向到struts.xml的最佳方法
示例:www.abc.com/employee/24/edit www.abc.com/employee/25/edit
答案 0 :(得分:0)
<result name="redirect" type="redirect">employee/${employee_id}/edit</result>
在行动中:
private String employee_id;
//create getter & setter for employee_id
public String execute()
{
Integer EmployeeId= .... // do other stuff to get employee id
employee_id = EmployeeId;
//this.employee_id=EmployeeId;
return "redirect";
}