1 48 49 50 package com.caucho.portal.generic.taglib; 51 52 import javax.portlet.RenderResponse; 53 import javax.servlet.ServletRequest ; 54 import javax.servlet.jsp.JspException ; 55 import javax.servlet.jsp.tagext.TagSupport ; 56 import java.io.IOException ; 57 58 public class NamespaceTag extends TagSupport { 59 public int doStartTag() 60 throws JspException 61 { 62 ServletRequest request = pageContext.getRequest(); 63 RenderResponse response = (RenderResponse) 64 request.getAttribute("javax.portlet.renderResponse"); 65 String namespace = response.getNamespace(); 66 67 if (namespace == null) 68 namespace = "null"; 69 70 try { 71 pageContext.getOut().print(namespace); 72 } 73 catch (IOException ex) { 74 throw new JspException (ex); 75 } 76 77 return EVAL_PAGE; 78 } 79 } 80 | Popular Tags |