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" "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd"> <portlet-app> ...
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:
<mbean code="org.jboss.portal.core.aspects.portlet.HeaderInterceptor" name="portal:service=Interceptor,type=Portlet,name=Header" xmbean-dd="" xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean"> <xmbean/> </mbean>
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!