Freitag, 6. August 2010

Adjusting the Spring Webflow swf-booking-portlet-faces for use with Pluto 2.02

Here is what I did to get the spring webflow portlet sample running with Pluto 2.02.

Several tweaks to the war that is provided on the Spring Webflow sample page are necessary:
  • remove com.springsource.javax.el-2.1.0.jar and el-ri-1.0.jar from WEB-INF/lib, a different EL implementation comes with Pluto 2.02, and two EL implementations cause trouble in Tomcats classloader
  • add WEB-INF/classes/../FaceletPortletViewHandler.class from the sample portlet in https://facelets.dev.java.net/files/documents/3448/21118/facelets-portlets.war, it does not come with the com.springsource.com.sun.facelets-1.1.15.jar. Maybe it will be part of newer facelet implementations, in that case you do not need it. This is a solution for the classcast exception saying "org.apache.pluto.container.impl.RenderResponseImpl cannot be cast to javax.servlet.ServletResponse". The reason is that Pluto 2.x, adhering to the Portlet 2.0 spec, now uses implementations of PortletRequest/PortletResponse, which do not extend ServletRequest/ServletResponse. The FaceletViewHandler tries to cast the response from the faces context to a servlet response, the FaceletPortletViewHandler avoids that cast.
    I found the explanation for that problem here http://osdir.com/ml/pluto-user-portals.apache.org/2010-04/msg00016.html and the solution here: http://old.nabble.com/Facelets-in-portlet-td18131659.html
  • edit faces-config.xml to use the FaceletPortletViewHandler instead of FaceletViewHandler
  • exchange jsf-portlet.jar 1.2.3 by current one 1.2.5 from http://jsfportletbridge.dev.java.net (not sure if this is necessary)
Afterwards the portlet ran on my Pluto installation. However, it is not exactly pretty.
The booking sample page does not display properly with the Pluto css, the radio buttons are drawn over the labels. A quick fix which proves that css causes that problem is to adjust /pluto/pluto.css for the label object:
label {
width: 60%;
text-align: right;
margin: 0px 5px 10px 0px;
}

Keine Kommentare:

Kommentar veröffentlichen