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 ActionURLTag extends BasicURLTag 44 { 45 46 49 public int doStartTag() throws JspException { 50 if (var != null) 51 { 52 pageContext.removeAttribute(var, PageContext.PAGE_SCOPE); 53 } 54 RenderResponse renderResponse = (RenderResponse)pageContext.getRequest().getAttribute("javax.portlet.response"); 55 56 if (renderResponse != null) 57 { 58 setUrl(renderResponse.createActionURL()); 59 if (portletMode != null) 60 { 61 try 62 { 63 PortletMode mode = new PortletMode(portletMode); 64 url.setPortletMode(mode); 65 } 66 catch (PortletModeException e) 67 { 68 throw new JspException (e); 69 } 70 } 71 if (windowState != null) 72 { 73 try 74 { 75 WindowState state = new WindowState(windowState); 76 url.setWindowState(state); 77 } 78 catch (WindowStateException e) 79 { 80 throw new JspException (e); 81 } 82 } 83 if (secure != null) 84 { 85 try 86 { 87 url.setSecure(getSecureBoolean()); 88 } 89 catch (PortletSecurityException e) 90 { 91 throw new JspException (e); 92 } 93 } 94 } 95 return EVAL_PAGE; 96 } 97 } 98 99 | Popular Tags |