After deployment, I get this error after loading the portlet :
[POP.001.0002] A “javax.portlet.PortletException” occurred with the Message “at com.webMethods.caf.faces.portlet.FacesPortlet.render(FacesPortlet.java:408)”
java.lang.StackOverflowError
I know that I get this error because I am calling recursively encodeBegin() and encodeEnd(). Base on this, is there another way to delegate the rendering to the default renderer?
I found out where my exception comes from. It is because I am overriding the default renderer of javax.faces.Button and my renderer becomes the base renderer. So when I call it, it calls itself recursively. This is why there is a stack overflow.
Although I understand what causes this exception, my problem is still unsolved.
How can I create a custom renderer in WM7 basing on the default renderer of the component without overriding it?
I am able to create a custom renderer in a JSF webapp by creating a Tag class, with a new component type, and use the tags inside my JSP file (cannot be done inside a WM7 .view file). How can I accomplish this in WM7?
MWS 7 does not support visual editing with custom components/renderers. However, if you register your custom components/renderers in your webapp’s faces-config.xml file, you can manually edit .view files to use your custom components/renderers.
For example, if you edit a .view file with a CommandButton control, you’ll see something like this:
You can replace the “renderer-type” attribute value with the renderer type of a renderer you registered in your faces-config.xml. You can also add arbitrary property elements to specify arbitrary component attributes which your custom renderer may use:
In your custom renderer encodeBegin() or encodeEnd() method, you could access the “myCustomAttribute” attribute via the following code: