1 16 19 20 26 package org.apache.pluto.tags; 27 28 import javax.portlet.PortletMode; 29 import javax.portlet.PortletModeException; 30 import javax.portlet.PortletSecurityException; 31 import javax.portlet.RenderResponse; 32 import javax.portlet.WindowState; 33 import javax.portlet.WindowStateException; 34 import javax.servlet.jsp.JspException ; 35 import javax.servlet.jsp.PageContext ; 36 37 43 public class RenderURLTag extends BasicURLTag 44 { 45 46 47 50 public int doStartTag() throws JspException { 51 if (var != null) 52 { 53 pageContext.removeAttribute(var, PageContext.PAGE_SCOPE); 54 } 55 RenderResponse renderResponse = (RenderResponse)pageContext.getRequest().getAttribute("javax.portlet.response"); 56 57 if (renderResponse != null) 58 { 59 setUrl(renderResponse.createRenderURL()); 60 if (portletMode != null) 61 { 62 try 63 { 64 PortletMode mode = new PortletMode(portletMode); 65 url.setPortletMode(mode); 66 } 67 catch (PortletModeException e) 68 { 69 throw new JspException (e); 70 } 71 } 72 if (windowState != null) 73 { 74 try 75 { 76 WindowState state = new WindowState(windowState); 77 url.setWindowState(state); 78 } 79 catch (WindowStateException e) 80 { 81 throw new JspException (e); 82 } 83 } 84 if (secure != null) 85 { 86 try 87 { 88 url.setSecure(getSecureBoolean()); 89 } 90 catch (PortletSecurityException e) 91 { 92 throw new JspException (e); 93 } 94 } 95 } 96 return EVAL_PAGE; 97 } 98 } 99 100 | Popular Tags |