[jboss-user] [JBoss Portal] - Re: Is header content injection coded in portal 2.4.0 ?

mvera do-not-reply at jboss.com
Fri Nov 3 13:02:10 EST 2006


This is the tag I use :


  | 
  | public class MyHeaderContentTagHandler extends SimpleTagSupport
  | {
  |    public void doTag() throws JspException, IOException
  |    {
  |       // get page and region
  |       PageContext app = (PageContext)getJspContext();
  |       HttpServletRequest request = (HttpServletRequest)app.getRequest();
  | 
  |       PageResult page = (PageResult)request.getAttribute(LayoutConstants.ATTR_PAGE);
  |       JspWriter out = this.getJspContext().getOut();
  |       if (page == null)
  |       {
  |          out.write("<p bgcolor='red'>No page to render!</p>");
  |          out.write("<p bgcolor='red'>The page to render (PageResult) must be set in the request attribute '" +
  |             LayoutConstants.ATTR_PAGE + "'</p>");
  |          out.flush();
  |          return;
  |       }
  | 
  |       Map results = page.getWindowResultMap();
  |       for (Iterator i = results.keySet().iterator(); i.hasNext();)
  |       {
  |          String windowID = (String)i.next();
  |          WindowResult result = page.getWindowResult(windowID);
  | 
  |          // START MODIFICATION
  |          Properties responseProperties = result.getResponseProperties();
  |          String headerContentProperty = responseProperties.getProperty("HEADER_CONTENT");
  |          if (headerContentProperty != null)
  |          {
  |             out.println(headerContentProperty);
  |          }
  |          // END MODIFICATION
  |          
  |          if (result.getHeaderContent() != null)
  |          {
  |             out.println(result.getHeaderContent());
  |          }
  |       }
  |       out.flush();
  |    }
  | }
  | 

But I'd prefer to use the original tag.

Mickaël

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983045#3983045

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983045




More information about the jboss-user mailing list