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

📄 actionurltagimpl.java

📁 GridSphere 门户 提供一个基于 portlet 的高级开放源代码门户。GridSphere 是在欧盟提供基金的 GridLab 项目下开发的
💻 JAVA
字号:
/** * @author <a href="mailto:novotny@gridsphere.org">Jason Novotny</a> * @version $Id: ActionURLTagImpl.java 4595 2006-03-06 00:23:28Z novotny $ */package org.gridsphere.provider.portlet.tags.jsr;import org.gridsphere.provider.portletui.beans.ActionLinkBean;import org.gridsphere.provider.portletui.beans.MessageStyle;import org.gridsphere.provider.portletui.tags.ActionTag;import javax.servlet.jsp.JspException;import javax.servlet.jsp.JspWriter;import javax.servlet.jsp.PageContext;/** * The <code>ActionLinkTag</code> provides a hyperlink element that includes a <code>DefaultPortletAction</code> * and can contain nested <code>ActionParamTag</code>s */public class ActionURLTagImpl extends ActionTag {    protected ActionLinkBean actionlink = null;    protected String style = MessageStyle.MSG_INFO;    /**     * 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>     *     * @return the text style     */    public String getStyle() {        return style;    }    public int doStartTag() throws JspException {        if (!beanId.equals("")) {            actionlink = (ActionLinkBean) pageContext.getAttribute(getBeanKey(), PageContext.REQUEST_SCOPE);            if (actionlink == null) {                actionlink = new ActionLinkBean();                actionlink.setStyle(style);                this.setBaseComponentBean(actionlink);            }        } else {            actionlink = new ActionLinkBean();            this.setBaseComponentBean(actionlink);            actionlink.setStyle(style);        }        if (name != null) actionlink.setName(name);        if (anchor != null) actionlink.setAnchor(anchor);        if (key != null) {            actionlink.setKey(key);            actionlink.setValue(getLocalizedText(key));        }        return EVAL_BODY_BUFFERED;    }    public int doEndTag() throws JspException {        paramPrefixing = false;        // set action to non-null        if (action == null) action = "";        String actionString = createActionURI();        actionlink.setAction(actionString);        if ((bodyContent != null) && (value == null)) {            actionlink.setValue(bodyContent.getString());        }        if (imageBean != null) {            String val = actionlink.getValue();            if (val == null) val = "";            actionlink.setValue(imageBean.toStartString() + val);        }        if (var == null) {            try {                JspWriter out = pageContext.getOut();                out.print(actionString);            } catch (Exception e) {                throw new JspException(e);            }        } else {            pageContext.setAttribute(var, actionString, PageContext.PAGE_SCOPE);        }        windowState = null;        portletMode = null;        return EVAL_PAGE;    }}

⌨️ 快捷键说明

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