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

📄 resourcebundleservicepropertyhandlerutil.java

📁 intra_mart是日本NDD公司开发的著名企业应用解决方案中间件。集成了J2ee服务器
💻 JAVA
📖 第 1 页 / 共 4 页
字号:

    /**
     * 張棟椺奜帪偺儁乕僕偺僷僗傪庢摼偟傑偡丅
     *
     * @param commonBundle 嫟捠偺儕僜乕僗僶儞僪儖
     * @return 慗堏愭偺儁乕僕偺僷僗
     * @throws ServicePropertyException 慗堏愭偺儁乕僕偺僷僗偺庢摼帪偵椺奜偑敪惗
     */
    public static String getServiceErrorPagePath(ResourceBundle commonBundle)
        throws ServicePropertyException {
        String page = null;

        try {
            page = commonBundle.getString("service.error.page.path");
        } catch (MissingResourceException e) {
            String message = null;
            try {
                message =
                    ResourceBundle
                        .getBundle("jp.co.intra_mart.framework.base.service.i18n")
                        .getString("ResourceBundleServicePropertyHandlerUtil.FailedToGetServiceErrorPagePath");
            } catch (MissingResourceException ex) {
            }
            throw new ServicePropertyException(message, e);
        }

        return page;
    }

    /**
     * 僔僗僥儉椺奜帪偺儁乕僕偺僷僗傪庢摼偟傑偡丅
     * 奩摉偡傞儁乕僕偺僷僗偑庢摼偱偒側偄応崌丄{@link #getSystemErrorPagePath(String, String)}偱庢摼偝傟傞儁乕僕傪曉偟傑偡丅
     *
     * @param commonBundle 嫟捠偺儕僜乕僗僶儞僪儖
     * @param applicationBundle 傾僾儕働乕僔儑儞偺儕僜乕僗僶儞僪儖
     * @param application 傾僾儕働乕僔儑儞ID
     * @param service 僒乕價僗ID
     * @param key 慗堏愭偺僉乕
     * @return 慗堏愭偺儁乕僕偺僷僗
     * @throws ServicePropertyException 慗堏愭偺儁乕僕偺僷僗偺庢摼帪偵椺奜偑敪惗
     */
    public static String getSystemErrorPagePath(
        ResourceBundle commonBundle,
        ResourceBundle applicationBundle,
        String application,
        String service,
        String key)
        throws ServicePropertyException {
        String page = null;

        try {
            page =
                applicationBundle.getString(
                    "system.error.page.path." + service + "." + key);
        } catch (MissingResourceException e) {
            try {
                page =
                    getSystemErrorPagePath(
                        commonBundle,
                        applicationBundle,
                        application,
                        service);
            } catch (ServicePropertyException ex) {
                String message = null;
                try {
                    message =
                        ResourceBundle
                            .getBundle("jp.co.intra_mart.framework.base.service.i18n")
                            .getString("ResourceBundleServicePropertyHandlerUtil.FailedToGetSystemErrorPagePath");
                } catch (MissingResourceException exc) {
                }
                throw new ServicePropertyException(
                    message
                        + " : application = "
                        + application
                        + ", service = "
                        + service
                        + ", key = "
                        + key,
                    e);
            }
        }

        return page;
    }

    /**
     * 僔僗僥儉椺奜帪偺儁乕僕偺僷僗傪庢摼偟傑偡丅
     * 奩摉偡傞儁乕僕偺僷僗偑庢摼偱偒側偄応崌丄{@link #getSystemErrorPagePath(String)}偱庢摼偝傟傞儁乕僕傪曉偟傑偡丅
     *
     * @param commonBundle 嫟捠偺儕僜乕僗僶儞僪儖
     * @param applicationBundle 傾僾儕働乕僔儑儞偺儕僜乕僗僶儞僪儖
     * @param application 傾僾儕働乕僔儑儞ID
     * @param service 僒乕價僗ID
     * @return 慗堏愭偺儁乕僕偺僷僗
     * @throws ServicePropertyException 慗堏愭偺儁乕僕偺僷僗偺庢摼帪偵椺奜偑敪惗
     */
    public static String getSystemErrorPagePath(
        ResourceBundle commonBundle,
        ResourceBundle applicationBundle,
        String application,
        String service)
        throws ServicePropertyException {
        String page = null;

        try {
            page =
                applicationBundle.getString(
                    "system.error.page.path." + service);
        } catch (MissingResourceException e) {
            try {
                page =
                    getSystemErrorPagePath(
                        commonBundle,
                        applicationBundle,
                        application);
            } catch (ServicePropertyException ex) {
                String message = null;
                try {
                    message =
                        ResourceBundle
                            .getBundle("jp.co.intra_mart.framework.base.service.i18n")
                            .getString("ResourceBundleServicePropertyHandlerUtil.FailedToGetSystemErrorPagePath");
                } catch (MissingResourceException exc) {
                }
                throw new ServicePropertyException(
                    message
                        + " : application = "
                        + application
                        + ", service = "
                        + service,
                    e);
            }
        }

        return page;
    }

    /**
     * 僔僗僥儉椺奜帪偺儁乕僕偺僷僗傪庢摼偟傑偡丅
     * 奩摉偡傞儁乕僕偺僷僗偑庢摼偱偒側偄応崌丄{@link #getSystemErrorPagePath()}偱庢摼偝傟傞儁乕僕傪曉偟傑偡丅
     *
     * @param commonBundle 嫟捠偺儕僜乕僗僶儞僪儖
     * @param applicationBundle 傾僾儕働乕僔儑儞偺儕僜乕僗僶儞僪儖
     * @param application 傾僾儕働乕僔儑儞ID
     * @return 慗堏愭偺儁乕僕偺僷僗
     * @throws ServicePropertyException 慗堏愭偺儁乕僕偺僷僗偺庢摼帪偵椺奜偑敪惗
     */
    public static String getSystemErrorPagePath(
        ResourceBundle commonBundle,
        ResourceBundle applicationBundle,
        String application)
        throws ServicePropertyException {
        String page = null;

        try {
            page = applicationBundle.getString("system.error.page.path");
        } catch (MissingResourceException e) {
            try {
                page = getSystemErrorPagePath(commonBundle);
            } catch (ServicePropertyException ex) {
                String message = null;
                try {
                    message =
                        ResourceBundle
                            .getBundle("jp.co.intra_mart.framework.base.service.i18n")
                            .getString("ResourceBundleServicePropertyHandlerUtil.FailedToGetSystemErrorPagePath");
                } catch (MissingResourceException exc) {
                }
                throw new ServicePropertyException(
                    message + " : application = " + application,
                    e);
            }
        }

        return page;
    }

    /**
     * 僔僗僥儉椺奜帪偺儁乕僕偺僷僗傪庢摼偟傑偡丅
     *
     * @param commonBundle 嫟捠偺儕僜乕僗僶儞僪儖
     * @return 慗堏愭偺儁乕僕偺僷僗
     * @throws ServicePropertyException 慗堏愭偺儁乕僕偺僷僗偺庢摼帪偵椺奜偑敪惗
     */
    public static String getSystemErrorPagePath(ResourceBundle commonBundle)
        throws ServicePropertyException {
        String page = null;

        try {
            page = commonBundle.getString("system.error.page.path");
        } catch (MissingResourceException e) {
            String message = null;
            try {
                message =
                    ResourceBundle
                        .getBundle("jp.co.intra_mart.framework.base.service.i18n")
                        .getString("ResourceBundleServicePropertyHandlerUtil.FailedToGetSystemErrorPagePath");
            } catch (MissingResourceException ex) {
            }
            throw new ServicePropertyException(message, e);
        }

        return page;
    }

    /**
     * 僩儔儞僕僔儑儞偺僋儔僗柤傪庢摼偟傑偡丅
     * 巜掕偝傟偨傾僾儕働乕僔儑儞ID偲僒乕價僗ID偵懳墳偡傞僩儔儞僕僔儑儞柤傪庢摼偟傑偡丅
     * 摿偵愝掕偝傟偰偄側偄応崌丄null偑曉傝傑偡丅
     *
     * @param applicationBundle 傾僾儕働乕僔儑儞偺儕僜乕僗僶儞僪儖
     * @param application 傾僾儕働乕僔儑儞ID
     * @param service 僒乕價僗ID
     * @return 僩儔儞僕僔儑儞偺僋儔僗柤丄愝掕偝傟偰偄側偄応崌偼null
     * @throws ServicePropertyException 僩儔儞僕僔儑儞偺僋儔僗柤偺庢摼帪偵椺奜偑敪惗
     */
    public static String getTransitionName(
        ResourceBundle applicationBundle,
        String application,
        String service)
        throws ServicePropertyException {
        String controller;

        try {
            controller =
                applicationBundle.getString("transition.class." + service);
        } catch (MissingResourceException e) {
            controller = null;
        }

        return controller;
    }

    /**
     * 僒乕價僗僒乕僽儗僢僩偺僷僗傪庢摼偟傑偡丅
     *
     * @param commonBundle 嫟捠偺儕僜乕僗僶儞僪儖
     * @return 僒乕價僗僒乕僽儗僢僩偺僷僗
     * @throws ServicePropertyException 僒乕價僗僒乕僽儗僢僩偺僷僗偺庢摼帪偵椺奜偑敪惗
     */
    public static String getServiceServletPath(ResourceBundle commonBundle)
        throws ServicePropertyException {
        String path;

        try {
            path = commonBundle.getString("servlet.path");
        } catch (MissingResourceException e) {
            String message = null;
            try {
                message =
                    ResourceBundle
                        .getBundle("jp.co.intra_mart.framework.base.service.i18n")
                        .getString("ResourceBundleServicePropertyHandlerUtil.FailedToGetServiceServletPath");
            } catch (MissingResourceException ex) {
            }
            throw new ServicePropertyException(message, e);
        }

        return path;
    }

    /**
     * 僐儞僥僉僗僩僷僗傪庢摼偟傑偡丅
     *
     * @param commonBundle 嫟捠偺儕僜乕僗僶儞僪儖
     * @return 僐儞僥僉僗僩僷僗
     * @throws ServicePropertyException 僐儞僥僉僗僩僷僗偺庢摼帪偵椺奜偑敪惗
     * @deprecated 偙偺儊僜僢僪偱偼側偔丄javax.servlet.http.HttpRequest偺getContextPath傪巊梡偡傞傛偆偵偟偰偔偩偝偄丅
     */
    public static String getContextPath(ResourceBundle commonBundle)
        throws ServicePropertyException {
        String path;

        try {
            path = commonBundle.getString("context.path");

⌨️ 快捷键说明

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