1 Reply Latest reply on Nov 2, 2006 2:08 PM by Vera Mickael

    Header content injection programatically (with code protecti

    Vera Mickael Newbie

      Hi everybody,

      I use JBossPortal 2.4.0 bundled.

      I have problems to set header content programatically. I need to do it this way as my css is dynamically set for each user.

      So I tried to use this way I found on this site :

      rr.addProperty("HEADER_CONTENT", _htmlBuff.toString())


      My debugger says me the code is executed and the content is the one I want,
      <script> ... </script>


      This code is executed inside a JSP tag from mine, I managed to get a render response inside the tag.

      But I still have an empty header content :

      <!-- insert header content that was possibly set by portlets on the page -->
      
      </head>
      

      I also read on this forum that I had to use a tag :

      <head>
       <title><JBoss Portal 2.2 early</title>
       <meta http-equiv="Content-Type" content="text/html;" />
      
       <p:headerContent />
      
       </head>


      I don't understand why this example includes a header in its html fragment as I did everything to avoid any or tag in the html generated by my portlet ? I thought a good practice was to provide the portal only an HTML fragment, but in examples I see complete HTML pages.

      What is the good practice ? What is the solution ?

      Thanks for reading my question.

      Mickaël