📄 roleaction.java
字号:
package yyxtong.struts.privilege.action;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
import yyxtong.service.servicefactory.IServiceFactory;
import yyxtong.struts.privilege.form.RoleForm;
public class RoleAction extends DispatchAction {
private IServiceFactory serviceFactory;
public void setServiceFactory(IServiceFactory serviceFactory) {
this.serviceFactory = serviceFactory;
}
public ActionForward showRole(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
RoleForm roleForm = (RoleForm)form;
List list = serviceFactory.getPrivilegeService().showRole();
if(list != null){
roleForm.setList(list);
return mapping.findForward("showRole");
}
return mapping.findForward("error");
}
public ActionForward showModule(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
RoleForm roleForm = (RoleForm)form;
List list_showModule = serviceFactory.getPrivilegeService().showModule();
roleForm.setList_showModule(list_showModule);
return mapping.findForward("showModule");
}
public ActionForward addRole(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
RoleForm roleForm = (RoleForm)form;
serviceFactory.getPrivilegeService().addRole(roleForm);
return mapping.findForward("addModule_ok");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -