These are my notes on how to reverse engineer what tags are doing in a JSF application. In this case, I am trying to figure out what are the classes behind the Configuration tags in the RHQ. I am trying to figure out what is being done by the tag
onc:config
This tag is activated with the following value at the top of the page:
xmlns:onc=”http://jboss.org/on/component”
To Figure out what this tag means, I look in WEB-INF/web.xml. The web.xml value
facelets.LIBRARIES
Lets me know where the file is that defines the acceptable tags I can add to an xhtml page for this component.
/WEB-INF/tags/on.component.taglib.xml
This taglib defines the values
tag-name config
component-type org.jboss.on.Config
renderer-type org.jboss.on.Config
Note that these are JSF component names, and not Java class names. To resolve these to Java classes, we need to find the mappings. The mapping files are defined in web.xml under the entry:
javax.faces.CONFIG_FILES
In particular, I found what I wanted in
/WEB-INF/jsf-components/configuration-components.xml,
The values I care about are:
component-type org.jboss.on.Config
component-class org.rhq.core.gui.configuration.ConfigUIComponent
and the renderer for Config and ConfigurationSet components
component-family rhq
renderer-type org.jboss.on.Config
renderer-class org.rhq.core.gui.configuration.ConfigRenderer
This render extends javax.faces.render.Renderer. This is a Flyweight that parses and generates HTML. It has two main methods: decode an encode. decode parses the request that comes in, encode injects html into the response that goes out.
Decode appears to be called only on a post. Encode seems to be called even on a get.
You have an intriguing blog Adam. You and I are a lot alike, both geeks and musicians. I stumbled on your treatment of Springsteen’s Blinded By The Light and was very impressed by the amount of analysis you put into it. Keep up the good work!
You’re the first person to comment on my blog since I took it public again. Thanks for the comment, I really enjoy a good argument and the comments where people disagree with me are so much more fun than the ones where they agree. Be on the look out for a response. I printed your comment and am preparing my response. Thanks again. I really do appreciate the counterpoint.