希望能够在 Action 中处理 Struts 2 提供的参数。
在 strtus2.xml 中输入下面的内容:
[code]
false /WEB-INF/jsp/addEditUser.jsp true /WEB-INF/jsp/addEditUser.jsp [/code]在 Action 中进行如下处理:
[code]public class AddEditUserAction {
private boolean isEdit;
// this is called by the struts.xml to set the value
public void setEdit(final boolean edit) {
isEdit = edit;
}
}[/code]
就可以了。