CRM系統開發過程中的CRUD模板

iteye_21202發表於2013-05-09

一、Action

public String list(){

return "list";
}

public String add(){

return "toList";
}

public String addUI(){

return "saveUI";
}


public String update(){

return "toList";
}

public String updateUI(){

return "saveUI";
}

public String delete(){

return "toList";
}


二、struts.xml


<action name="department_*" class="departmentAction" method="{1}">
<result name="list">/WEB-INF/jsp/departmentAction/list.jsp</result>
<result name="toList" type="redirectAction">department_list?parentId=${parentId}</result>
<result name="saveUI">/WEB-INF/jsp/departmentAction/saveUI.jsp</result>

</action>


或者

<package name="ssh2" namespace="/" extends="struts-default">
<action name="user_*" class="userAction" method="{1}">
<result name="list">list.jsp</result>
<result name="toList" type="redirectAction">user_list</result>
<result name="saveUI">saveUI.jsp</result>

</action>
</package>

相關文章