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

📄 messageboxtag.java

📁 GridSphere 门户 提供一个基于 portlet 的高级开放源代码门户。GridSphere 是在欧盟提供基金的 GridLab 项目下开发的
💻 JAVA
字号:
package org.gridsphere.provider.portletui.tags;import org.gridsphere.provider.portletui.beans.MessageBoxBean;import javax.servlet.jsp.JspException;import javax.servlet.jsp.JspWriter;/* * @author <a href="mailto:oliver.wehrens@aei.mpg.de">Oliver Wehrens</a> * @version $Id: MessageBoxTag.java 4745 2006-04-10 22:17:39Z novotny $ */public class MessageBoxTag extends BaseComponentTag {    protected MessageBoxBean messageBoxBean = null;    protected String style = null;    /**     * Sets the style of the text: Available styles are     * <ul>     * <li>nostyle</li>     * <li>error</li>     * <li>info</li>     * <li>status</li>     * <li>alert</li>     * <li>success</li>     *     * @param style the text style     */    public void setStyle(String style) {        this.style = style;    }    /**     * Returns the style of the text: Available styles are     * <ul>     * <li>nostyle</li>     * <li>error</li>     * <li>info</li>     * <li>status</li>     * <li>alert</li>     * <li>success</li>     * <li>bold</li>     * <li>italic</li>     * <li>underline</li>     *     * @return the text style     */    public String getStyle() {        return style;    }    public int doStartTag() throws JspException {        return EVAL_BODY_INCLUDE;    }    public int doEndTag() throws JspException {        if (!beanId.equals("")) {            messageBoxBean = (MessageBoxBean) getTagBean();            if (messageBoxBean == null) {                messageBoxBean = new MessageBoxBean();                this.setBaseComponentBean(messageBoxBean);            } else {                this.updateBaseComponentBean(messageBoxBean);                key = messageBoxBean.getKey();            }        } else {            messageBoxBean = new MessageBoxBean();            this.setBaseComponentBean(messageBoxBean);        }        if (style != null) {            messageBoxBean.setMessageType(style);        }        if (key != null) {            messageBoxBean.setValue(getLocalizedText(key));        }        try {            JspWriter out = pageContext.getOut();            out.print(messageBoxBean.toEndString());        } catch (Exception e) {            throw new JspException(e.getMessage());        }        return EVAL_PAGE;    }}

⌨️ 快捷键说明

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