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

📄 jndiutil.java~

📁 《Java网络程序设计.rar》包括三个网络程序的源代码。
💻 JAVA~
字号:
/**/package org.impact.stars.util;import javax.naming.InitialContext;import javax.naming.NamingException;import com.sun.j2ee.blueprints.util.tracer.Debug;/** * This class implements convenience methods to access JNDI * entries. It is typically used to access application * properties that were configured through deployment * descriptor and hence are accessible through JNDI namespace. */public final class JNDIUtil implements JNDINames {    /**     * a convenience method to get the boolean value corresponding     * to the SEND_CONFIRMATION_MAIL property.     */    public static boolean sendConfirmationMail() {        boolean boolVal = false;        try {            InitialContext ic = new InitialContext();            Boolean bool = (Boolean)                ic.lookup(JNDINames.SEND_CONFIRMATION_MAIL);            if (bool != null) {                boolVal = bool.booleanValue();            }        } catch (NamingException ne) {            // If property is not present in the deployment            // descriptor, conservatively assume that we do not send            // confirmation mail for each order.            Debug.print(ne);        }        return boolVal;    }}

⌨️ 快捷键说明

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