serviceaction.java

来自「struts+hibernate3的源程序」· Java 代码 · 共 37 行

JAVA
37
字号
package org.helpsoft.actions;

import com.helpsoft.util.genelv.struts.GenericAction;
import java.text.SimpleDateFormat;
import com.helpsoft.Constants;
import org.helpsoft.servicelocator.*;
import com.helpsoft.util.genelv.struts.GenericForm;
import org.helpsoft.session.AssociatorManageService;

/**
 * Base action that has access to the service methods.
 *
 * @author  cao guangxin - www.relationinfo.com
 * @version $Revision: 1.2 $, $Date: 2005/02/20 11:31:22 $
 */
public abstract class ServiceAction extends GenericAction {

   protected static final SimpleDateFormat TIMESTAMP_FORMATTER =
         new SimpleDateFormat(Constants.TIMESTAMP_DISPLAY_FORMAT);

   protected static final SimpleDateFormat DATE_FORMATTER =
         new SimpleDateFormat(Constants.DATE_DISPLAY_FORMAT);


    /**
    * Get the service interface.
    * @return AssociatorManageService interface
    */
    public static AssociatorManageService getAssociatorManageService() {
    try {
        return (AssociatorManageService) ServiceLocator.getService(ServiceLocator.ASSOCIATORMANAGE_SERVICE);
        } catch (Exception e) {
            return null;
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?