⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 intramartpagebasetransition.java

📁 intra_mart是日本NDD公司开发的著名企业应用解决方案中间件。集成了J2ee服务器
💻 JAVA
字号:
/*
 * IntramartPageBaseTransition.java
 *
 * Created on 2002/07/02, 13:44
 */

package jp.co.intra_mart.framework.base.service;

import java.util.Locale;

import javax.servlet.RequestDispatcher;

import jp.co.intra_mart.framework.system.exception.SystemException;
import jp.co.intra_mart.jssp.net.GenericURLBuilder;

/**
 * 儁乕僕儀乕僗偺夋柺偵慗堏偡傞応崌偵巊梡偡傞僩儔儞僕僔儑儞偱偡丅
 *
 * @author INTRAMART
 * @since 3.2
 */
public class IntramartPageBaseTransition extends Transition {

    /**
     * IntramartPageBaseTransition傪怴婯偵惗惉偟傑偡丅
     */
    public IntramartPageBaseTransition() {
    }

    /**
     * 擖椡僄儔乕偺儁乕僕傪庢摼偟傑偡丅
     *
     * @param e 擖椡帪偺椺奜
     * @return 擖椡僄儔乕儁乕僕
     * @throws ServicePropertyException 慗堏儁乕僕庢摼帪偵僒乕價僗僾儘僷僥傿椺奜偑敪惗
     * @throws TransitionException 慗堏儁乕僕庢摼帪偵椺奜偑敪惗
     */
    public String getInputErrorPage(RequestException e)
        throws ServicePropertyException, TransitionException {

        Locale locale =
            getServiceManager().getLocale(getRequest(), getResponse());

        return getServiceManager()
            .getServicePropertyHandler()
            .getInputErrorPagePath(
            getApplication(),
            getService(),
            e.getClass().getName(),
            locale);
    }

    /**
     * 張棟僄儔乕偺儁乕僕傪庢摼偟傑偡丅
     *
     * @param e 張棟帪偺椺奜
     * @return 張棟僄儔乕儁乕僕
     * @throws ServicePropertyException 慗堏儁乕僕庢摼帪偵僒乕價僗僾儘僷僥傿椺奜偑敪惗
     * @throws TransitionException 慗堏儁乕僕庢摼帪偵椺奜偑敪惗
     */
    public String getServiceErrorPage(Exception e)
        throws ServicePropertyException, TransitionException {

        Locale locale =
            getServiceManager().getLocale(getRequest(), getResponse());

        return getServiceManager()
            .getServicePropertyHandler()
            .getServiceErrorPagePath(
            getApplication(),
            getService(),
            e.getClass().getName(),
            locale);
    }

    /**
     * 僔僗僥儉僄儔乕偺儁乕僕傪庢摼偟傑偡丅
     *
     * @param e 張棟帪偺椺奜
     * @return 僔僗僥儉僄儔乕儁乕僕
     * @throws ServicePropertyException 慗堏儁乕僕庢摼帪偵僒乕價僗僾儘僷僥傿椺奜偑敪惗
     * @throws TransitionException 慗堏儁乕僕庢摼帪偵椺奜偑敪惗
     */
    public String getSystemErrorPage(Exception e)
        throws ServicePropertyException, TransitionException {

        Locale locale =
            getServiceManager().getLocale(getRequest(), getResponse());

        return getServiceManager()
            .getServicePropertyHandler()
            .getSystemErrorPagePath(
            getApplication(),
            getService(),
            e.getClass().getName(),
            locale);
    }

    /**
     * 師偵慗堏偡傞儁乕僕傪庢摼偟傑偡丅
     *
     * @return 師偵慗堏偡傞儁乕僕
     * @throws ServicePropertyException 慗堏儁乕僕庢摼帪偵僒乕價僗僾儘僷僥傿椺奜偑敪惗
     * @throws TransitionException 慗堏儁乕僕庢摼帪偵椺奜偑敪惗
     */
    public String getNextPage()
        throws ServicePropertyException, TransitionException {
        return getNextPagePath();
    }

    /**
     * 師偺慗堏愭偵搉偡忣曬傪愝掕偟傑偡丅
     *
     * @throws TransitionException 忣曬愝掕帪偵椺奜偑敪惗
     */
    public void setInformation() throws TransitionException {
    }

    /**
     * 儁乕僕儀乕僗偺夋柺偵慗堏偟傑偡丅
     * 慗堏偡傞曽朄偼師偺儁乕僕偱梫媮偝傟傞宍幃偵埶懚偟傑偡丅
     *
     * @throws SystemException 僔僗僥儉椺奜偑敪惗
     * @since 3.2
     */
    public void transfer() throws SystemException {
    	String url = null;
        try {
        	GenericURLBuilder builder = new GenericURLBuilder(getRequest(), getResponse());
            url = builder.createFilePath(getNextPage());
        } catch (Exception e) {
            throw new SystemException(e.getMessage(), e);
        }

        // 懠偺僒乕僽儗僢僩偵傛偭偰include偝傟偰偄傞偐偳偆偐僠僃僢僋
        String requestURI =
            (String)getRequest().getAttribute(
                "javax.servlet.include.request_uri");
        String contextPath =
            (String)getRequest().getAttribute(
                "javax.servlet.include.context_path");
        String servletPath =
            (String)getRequest().getAttribute(
                "javax.servlet.include.servlet_path");
        RequestDispatcher dispatcher =
            getRequest().getRequestDispatcher(url);
        try {
            if (requestURI != null
                && !requestURI.equals("")
                || contextPath != null
                && !contextPath.equals("")
                || servletPath != null
                && !servletPath.equals("")) {

                // 懠偺僒乕僽儗僢僩偵傛偭偰include偝傟偰偄傞応崌
                dispatcher.include(getRequest(), getResponse());

            } else {
                // 懠偺僒乕僽儗僢僩偵傛偭偰include偝傟偰偄側偄応崌
                dispatcher.forward(getRequest(), getResponse());
            }
        } catch (Exception e) {
            throw new SystemException(e.getMessage(), e);
        }
    }
}

⌨️ 快捷键说明

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