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

dkrieger do-not-reply at jboss.com
Sat Dec 13 23:28:06 EST 2008


I am running into the same problem as andiXT.

I am running with JDK 6: 1.6.0_07

Doing a bit more inspecting I think I have found the problem, but unfortunately do not have a solid solution for it:

PortletResponseImpl creates an element based on the default document factory for your java implementation.  In my case I get back an instance of org.apache.xerces.dom.ElementImpl

Inside of HeaderContentTagHandler when its going through the list of header elements, it simply appends the element to the output buffer.  This forces a  toString() call on the element.  This is where the randomness may occur depending on the implementation.

I looked at the latest xerces source and the toString() implementation in NodeImpl (parent class for ElementImpl which contains toString() function) doesn't actually output the element in xml format, but instead is for debug purposes only: 


  |     //
  |     // Object methods
  |     //
  | 
  |     /** NON-DOM method for debugging convenience. */
  |     public String toString() {
  |         return "["+getNodeName()+": "+getNodeValue()+"]";
  |     }
  | 

I found a solution using Xerces to do the serializing.  Its not that elegant of a solution, but it seems many of the elements that are injected via jboss-portlet.xml injection method are W3C Elements that throw UnsupportedOperationException.  

I created a JIRA entry and patch which should resolve this issue for everybody:

https://jira.jboss.org:8443/jira/browse/JBPORTAL-2260

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

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



More information about the jboss-user mailing list