4 Replies Latest reply on Sep 4, 2008 2:25 AM by mbien

    JBoss Portal Portlet 2.0 compatiblility

    mbien

      Hello everyone,

      is the JBoss Portal 2.7.0b implementation of the Portlet 2.0 spec already feature complete?

      I got a ClassCastException in my prototype while evaluating the Portal event wirering.

      @Override
      public void processEvent(EventRequest request, EventResponse response) throws PortletException, IOException {
       System.out.println("portlet 2.0 events rock!")
       //...
       //...
       PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/WEB-INF/iframe/iframe.jsp");
       prd.include(request, response);
      }
      




      portlet 2.0 events rock!
      java.lang.ClassCastException: org.jboss.portal.portlet.impl.jsr168.api.EventRequestImpl cannot be cast to javax.portlet.RenderRequest
      at org.jboss.portal.portlet.impl.jsr168.taglib.DefineObjectsTag.doEndTag(DefineObjectsTag.java:63)
      at org.apache.jsp.WEB_002dINF.iframe.iframe_jsp._jspService(iframe_jsp.java:67)
      at org.jboss.portal.core.servlet.jsp.PortalJsp.service(PortalJsp.java:143)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      ...

      (afaik JBP should expect a PortletRequest instead of a RenderRequest if it implements the Portlet 2.0 spec at this point)

      I also noticed some differences comparing the jboss doc with the apache pluto portlet 2.0 reference impl (e.g PortletRequestDispatcher):
      http://portals.apache.org/pluto/portlet-api/apidocs/javax/portlet/PortletRequestDispatcher.html
      http://docs.jboss.com/jbportal/v2.7.0.B1/javadoc/portlet/javax/portlet/PortletRequestDispatcher.html

      thank you in advance,

      mbien

        • 1. Re: JBoss Portal Portlet 2.0 compatiblility
          theute

          Yes 2.0 is fully implemented in 2.7.0
          There is some work to do on error handling though.

          Check your code, you probably did something wrong.

          As for the Javadoc is concerned. The javadoc you mention is the one for the JSR-168, the one on Pluto for JSR-286.
          (You can still write JSR-168 portlets with 2.7.0.Beta1)

          • 2. Re: JBoss Portal Portlet 2.0 compatiblility
            mbien

            wow that was fast!

            "thomas.heute@jboss.com" wrote:
            Yes 2.0 is fully implemented in 2.7.0
            There is some work to do on error handling though.

            Check your code, you probably did something wrong.

            this is possible (I am new with portlets) but I am actually only dispatching the request / response events from whithin the event handler method.

            "thomas.heute@jboss.com" wrote:
            Yes 2.0 is fully implemented in 2.7.0
            As for the Javadoc is concerned. The javadoc you mention is the one for the JSR-168, the one on Pluto for JSR-286.
            (You can still write JSR-168 portlets with 2.7.0.Beta1)

            this is what I suspected, but the doc claims to be a portlet 2.0 doc ;)
            http://docs.jboss.com/jbportal/v2.7.0.B1/javadoc/portlet/


            • 3. Re: JBoss Portal Portlet 2.0 compatiblility
              theute

              My bad, didn't look at your few lines of code.
              You cannot do rendering during the event phase (so you can't include a JSP).

              Any rendering has to happen during the RENDER phase.

              Mmmm ok the javadoc is not accurate ;)

              • 4. Re: JBoss Portal Portlet 2.0 compatiblility
                mbien

                thank you, works perfectly.