2 Replies Latest reply on Apr 22, 2008 11:13 AM by Louis daRosa

    Portlet Header Injection

    Louis daRosa Newbie

      I have been trying to get portlet header injection to work via jboss-portlet.xml without any luck. I am running on Jboss Portal 2.6. My jboss-portlet.xml contains the following:

       <link rel="stylesheet" type="text/css" href="/css/welcome.css" />

      In the head for my theme I have the <p:headerContent /> tag, but when the page loads there is no link tag injected. Anyone seen this issue and know what could be going on?

        • 1. Re: Portlet Header Injection
          Eric Smith Newbie

          I am injecting both link and script this way without problem. One thought might be if your portlet-name (welcome) did not match the same value in portlet.xml?

          Also check your jboss log file after you deploy -- I've had silent failures when the parsing of the jboss-portlet.xml fails due to a syntax error. After the INFO
          [TomcatDeployer] deploy line in the log you should see an INFO [PortletAppDeployment] Parsing /xyz/jboss-portlet.xml line.

          File ideally would now use DTD at top, although shouldnt matter.

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE portlet-app PUBLIC
           "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"

          • 2. Re: Portlet Header Injection
            Louis daRosa Newbie

            Thanks for the response. Turns out everything was fine in my jboss-portlet.xml. I ended up grabbing the jboss source and walking through the code in the debugger. Turns out that the HeaderInterceptor was never being called. At some point it looks like my Interceptor declarations were messed up. Just in case anyone else gets into this state there are two lines that need to be in your jboss-service.xml /server/default/deploy/jboss-portal/sar/META-INF/jboss-service.xml.

            The first is:


            The second, and the one that had been removed in my deployment is in the depends-list for the JbossInterceptorStackFactory:

            After adding that in, everything works like a charm!