[jboss-user] [JBoss Portal] - Injection of header content (title, scripts) with portal 2.7

andiXT do-not-reply at jboss.com
Thu Nov 13 06:39:20 EST 2008


Hi,

How I can inject header content - titles, keywords, scripts, etc with new Portal 2.7? I have done as described in Reference Guide but unfortunatelly it doesn't work. My Portlet extends GenericPortlet and it overrides method doHeaders:

  | public class InfoPortlet extends GenericPortlet {
  |     public void doView(RenderRequest request, 
  |                        RenderResponse response) throws PortletException, 
  |                                                        IOException {
  | ....
  | }
  |     public void doHeaders(RenderRequest request, RenderResponse response){
  |         Element element = response.createElement("title");
  |         element.setTextContent("My new web browser title");
  |         response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, element);
  |     }
  | }
  | 

Also I have used previous way to set header content but it also doesn't work.

  | response.setProperty("HEADER_CONTENT",getPageHeaderTags(metaHeaders));
  | 
Layout of that pages includes 


  | ...
  | <%@ taglib uri="/WEB-INF/portal-layout.tld" prefix="p" %>
  | ...
  | <html xmlns="http://www.w3.org/1999/xhtml">
  | <head>
  |     <meta http-equiv="Content-Type" content="text/html"/>
  |     <script type="text/javascript"></script>
  |     <p:headerContent/>
  | </head>
  | ...
  | 

Seems like everything is done correctly but it doesn't work. 
Any help is appreciated.

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

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



More information about the jboss-user mailing list