📄 renderurltagimpl.java
字号:
/** * @author <a href="mailto:novotny@gridsphere.org">Jason Novotny</a> * @version $Id: RenderURLTagImpl.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;import java.util.ArrayList;/** * The <code>ActionLinkTag</code> provides a hyperlink element that includes a <code>DefaultPortletAction</code> * and can contain nested <code>ActionParamTag</code>s */public class RenderURLTagImpl 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); paramBeans = new ArrayList(); if (key != null) { actionlink.setKey(key); actionlink.setValue(getLocalizedText(key)); } return EVAL_BODY_INCLUDE; } public int doEndTag() throws JspException { paramPrefixing = false; String actionString = createRenderURI(); //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.getMessage()); } } 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 + -