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

📄 guiutil.java

📁 一个使用struts+hibernate+spring开发的完的网站源代码。
💻 JAVA
字号:
package org.apache.myfaces.examples.util;import javax.faces.context.FacesContext;import java.util.ResourceBundle;import java.util.MissingResourceException;import java.text.MessageFormat;/** * @author Thomas Spiegl (latest modification by $Author: matzew $) * @version $Revision: 1.1 $ $Date: 2005/03/24 16:47:11 $ */public class GuiUtil{    private static String BUNDLE_NAME = "org.apache.myfaces.examples.resource.example_messages";    public static String getMessageResource(String key, Object[] arguments)    {        FacesContext context = FacesContext.getCurrentInstance();        String resourceString;        try        {            ResourceBundle bundle = ResourceBundle.getBundle(BUNDLE_NAME, context.getViewRoot().getLocale());            resourceString = bundle.getString(key);        }        catch (MissingResourceException e)        {            return key;        }        if (arguments == null) return resourceString;        MessageFormat format = new MessageFormat(resourceString, context.getViewRoot().getLocale());        return format.format(arguments);    }}

⌨️ 快捷键说明

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