📄 categorytreehandler.java
字号:
package com.jdon.estore.web.catalog.tree;import com.jdon.strutsutil.*;import javax.servlet.http.HttpServletRequest;import com.jdon.bussinessproxy.ServiceServerFactory;import com.jdon.bussinessproxy.EJBDefinition;import com.jdon.controller.model.Model;import com.jdon.controller.events.*;import com.jdon.estore.model.Category;import com.jdon.estore.web.catalog.CategoryForm;import com.jdon.estore.catalog.tree.CategoryTreeManagerLocal;import com.jdon.estore.FrameworkServices;/** * 管理树形结构,节点的增、删、改 * <p>Copyright: Jdon.com Copyright (c) 2003</p> * <p>Company: 上海解道计算机技术有限公司</p> * @author not attributable * @version 1.0 */public class CategoryTreeHandler implements ModelHandler { private final static ServiceServerFactory sf = ServiceServerFactory. getInstance(); public ModelForm initForm(HttpServletRequest request) throws Exception{ return new CategoryForm(); } public Model findModelByKey(String keyValue, HttpServletRequest request) throws Exception{ CategoryTreeManagerLocal catalogManager = (CategoryTreeManagerLocal) sf.getService( FrameworkServices.CategoryTreeEJB, request); return catalogManager.getCategoryById(keyValue); } public void serviceAction(EventModel em, HttpServletRequest request) throws java.lang. Exception { CategoryTreeManagerLocal catalogManager = (CategoryTreeManagerLocal) sf.getService( FrameworkServices.CategoryTreeEJB, request); try { switch (em.getActionType()) { case Event.CREATE: catalogManager.addCategory(em); break; case Event.EDIT: catalogManager.updateCategory(em); break; case Event.DELETE: catalogManager.removeCategory(em); break; } } catch (Exception ex) { throw new Exception("System operation Error:" + ex); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -