Forum Stats

  • 3,827,877 Users
  • 2,260,836 Discussions
  • 7,897,402 Comments

Discussions

PageFlow based portlet not rendering content

vali_nedelcu-JavaNet
vali_nedelcu-JavaNet Member Posts: 9
edited Sep 26, 2008 10:34AM in WebLogic Portal
Hello everybody,

I'm trying to use a page flow as a source for a portlet.
Unfortunately the portlet content is not rendered; instead, just the portlet window with the title bar is present.
(No error message is present on either the console or the server log.)

The PageFlow is a trivial one -- containing just the begin action and the index.jsp file (faces). I was able to test the pageflow directly from Workshop (choosing the `*Run on Server..*` menu action). The index.jsp content was rendered as expected. But when I tried the URLs for the portal or the portlet, no content was rendered!

Perhaps a sketch can explain better what I'm experiencing:

Request for `dummy JPF` URL ----------------------> content rendered (as expected)
Request for Portlet with `dummy JPF` URL ----------------------> NO content rendered (+unexpected+)

I tried the combinations: WebLogic Portal 10.2 + Workspace Studio 1.1 and WebLogicPortal 10.0 + Workshop for Weblogic Platform with the same result.

What is the problem?! Has anyone ever experienced something similar?
(According to the [BEA Portlet Dev docs|http://edocs.bea.com/wlp/docs100/portlets/building.html#wp1062050], using a PageFlow as a source for a portlet is a perfectly good option.)

Answers

  • 648793
    648793 Member Posts: 96
    edited Sep 15, 2008 10:48AM
    Hi
    Never encountered such an issue but i would do a couple of things to understand what is happening.
    1) See the the html source of page. Do you see anything from your JSP there.
    2) Put an System.out in your jsp. to make sure that your jsp is being called.
    3) Hard code something in the jsp like Hello world.
    4) Try to remove the portlet from that page, and add it again.

    Try these small things, they may give you some idea as to what is happening?
  • I will first answer the questions from the previous post:
    1) I looked at the generated HTML. No trace of the actual content.
    2,3) JSP is NOT called by the portal.

    I carefully reviewed the whole process of the creation of the JPF portlet, and I came to the conclusion that my issue has something to do with the fact that I've been trying to use a JSP page based on faces.
    These are the steps to reproduce the behavior:
    1) Create a new portlet of type ``Java Page Flow`` called ``dummyPageFlowPortlet``. You will end up with the following artifacts: src\*dummyPageFlowPortlet.java*; +<WebContent>+\dummyPageFlowPortlet.jsp and *dummyPageFlowPortlet
    .portlet*.
    On BEA Workspace Studio, the Java class looks like this:
    {color:#800000}@Jpf.Controller()
    public class dummyPageFlowPortlet extends PageFlowController
    {
    private static final long serialVersionUID = 1L;

    @Jpf.Action(
    forwards={
    @Jpf.Forward(name="index", path="/dummyPageFlowPortlet.jsp")
    }
    )
    protected Forward begin()
    {
    return new Forward("index");
    }
    }{color}
    The JSP page content is:
    {color:#339966}<netui:html>
    <head>
    <netui:base/>
    </head>
    <netui:body>
    <p>Beehive NetUI JavaServer Page - ${pageContext.request.requestURI}</p>
    </netui:body>
    </netui:html>{color}

    With these everything looks just fine; the portlet is rendered both in and outside of the portal and is displaying the text Beehive NetUI JavaServerPage - /webroot/dummyPageFlowPortlet.jsp.
    2) Now change the Java Page Flow to use a JSP based on Faces:
    {color:#800000}@Jpf.Controller()
    public class dummyPageFlowPortlet extends PageFlowController
    {
    private static final long serialVersionUID = 1L;

    @Jpf.Action(
    forwards={
    *@Jpf.Forward(name="index", path="/dummyPageFlowPortlet.faces")*
    }
    )
    protected Forward begin()
    {
    return new Forward("index");
    }
    }
    {color}
    3) Change the content of JSP file to:
    {color:#008000}<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://bea.com/faces/adapter/tags-naming" prefix="netuix"%>
    <f:view>
    <netuix:namingContainer id="facesContentDummy">
    Put your faces content here
    </netuix:namingContainer>
    </f:view>
    {color}

    Now if I access the JPF directly I can see that the content is generated and the page is displaying ``Put your faces content here``.
    But if I access the portlet, all I can get is an empty portlet frame.

    So I'm wondering if anyone can actually reproduce this behavior on Weblogic Portal 10.x using WorkSpace Studio or Workshop.
    What I'm doing wrong!?
  • 650542
    650542 Member Posts: 13
    How did you generate the portlet? Can you try:
    Right click on dummyPageFlowPortlet.java and select Generate portlet, right click on the generated portlet you should be able to run it and the jsp content should displayed
  • user9504443 wrote:
    How did you generate the portlet? Can you try:
    Right click on dummyPageFlowPortlet.java and select Generate portlet, right click on the generated portlet you should be able to run it and the jsp content should displayed
    I created the portlet using the New Portlet wizard (in Project Explorer view, right-click on the Web Portal Project then select New Portlet). The Page Flow was created by the wizard as part of portlet creation. (When I first noticed the funny behavior I was started the other way around - I created first the Page Flow THEN I used it at step 3 of `new portlet` wizard.
    I don't know why, but the JPF wizard seems to favor JSP generation using Faces. Also it generates a index.java file in the same package with the controller, annotated with @Jpf.FacesBacking())

    In fact, I created a new page flow called (with wizard) `Abc` and then used the `Generate Portlet..` as advised. I noticed (once again) that the generated JSP file index.jsp is in fact a JSF file. A request to this portlet generated the following trace on server log:

    <!--[if gte mso 9]><xml>
    1024x768
    </xml><![endif]--><!--[if gte mso 9]><xml>
    Normal
    0
    false
    false
    false
    MicrosoftInternetExplorer4
    </xml><![endif]--><!--[if gte mso 9]><xml>
    </xml><![endif]-->
    <!--[if gte mso 10]>
    <style>
    /* Style Definitions */
    table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;}
    </style>
    <![endif]-->
    &lt;Trace&gt;
    &lt;org.apache.beehive.netui.pageflow.PageFlowRequestProcessor&gt; &lt;------------------------------- Start
    Request #7 -----------------------------------&gt;

    &lt;Debug&gt;
    &lt;org.apache.beehive.netui.pageflow.DefaultPageFlowEventReporter&gt; &lt;beginActionRequest:
    Request=or[email protected]1227f7a,
    Response=org.ap[email protected]1df284c&gt;
    &lt;Debug&gt; &lt;org.apache.beehive.netui.core.urls.URLRewriterService&gt;
    &lt;Cannot register URLRewriter, "org.apache.beehive.netui.pageflow.internal.DefaultURLRewriter".
    The URLRewriter,
    "com.bea.netuix.servlets.controls.content.PageFlowContent$PFCUrlRewriter",
    is already registered and does not allow other rewriters.&gt;

    &lt;Info&gt; &lt;org.apache.beehive.netui.pageflow.PageFlowRequestProcessor&gt;
    &lt;Attempting to instantiate
    SharedFlowControllers for request
    /ParticipantPortalWeb/portlets/abc/begin.do&gt;

    &lt;Trace&gt;
    &lt;org.apache.beehive.netui.pageflow.internal.DeferredSessionStorageHandler
    &lt;getAttribute:
    portletsabc_AbcController_portlet_netui:sharedFlow:global.Global&gt;

    &lt;Trace&gt;
    &lt;org.apache.beehive.netui.pageflow.internal.DeferredSessionStorageHandler&gt;
    &lt;getAttribute: portletsabc_AbcController_portlet_netui:sharedFlow:global.Global&gt;
    &lt;Trace&gt;
    &lt;org.apache.beehive.netui.pageflow.internal.DeferredSessionStorageHandler&gt;
    &lt;getAttribute:
    portletsabc_AbcController_portlet_netui:curLongLivedModule&gt;

    &lt;Trace&gt;
    &lt;org.apache.beehive.netui.pageflow.internal.DeferredSessionStorageHandler&gt;
    &lt;getAttribute: portletsabc_AbcController_portlet_netui:curPageFlow&gt;

    &lt;Debug&gt; &lt;org.apache.beehive.netui.pageflow.PageFlowRequestProcessor&gt;
    &lt;Using current page flow: [email protected]&gt;

    &lt;Trace&gt;
    &lt;org.apache.beehive.netui.pageflow.internal.DeferredSessionStorageHandler&gt;
    &lt;getAttribute:
    portletsabc_AbcController_portlet_netui:curLongLivedModule&gt;

    &lt;Trace&gt;
    &lt;org.apache.beehive.netui.pageflow.internal.DeferredSessionStorageHandler&gt;
    &lt;getAttribute: portletsabc_AbcController_portlet_netui:curPageFlow&gt;

    &lt;Trace&gt; &lt;org.apache.beehive.netui.pageflow.internal.DeferredSessionStorageHandler&gt;
    &lt;removeAttribute: portletsabc_AbcController_portlet_netui:facesBacking&gt;
    &lt;Trace&gt;
    &lt;org.apache.beehive.netui.pageflow.internal.DeferredSessionStorageHandler&gt;
    &lt;getAttribute: portletsabc_AbcController_portlet_netui:facesBacking&gt;

    &lt;Debug&gt;
    &lt;org.apache.struts.action.RequestProcessor&gt; &lt;Processing a 'GET' for
    path '/begin'&gt;

    &lt;Debug&gt;
    &lt;org.apache.beehive.netui.pageflow.PageFlowRequestProcessor&gt; &lt;Populating
    bean properties from this request&gt;

    &lt;Trace&gt;
    &lt;org.apache.beehive.netui.pageflow.internal.DeferredSessionStorageHandler&gt;
    &lt;getAttribute:
    portletsabc_AbcController_portlet_netui:PageFlowControlContainerInstance&gt;

    &lt;Debug&gt;
    &lt;org.apache.beehive.netui.pageflow.DefaultPageFlowEventReporter&gt; &lt;actionRaised:
    [email protected],
    ActionMapping=ActionConfig[path=/begin,parameter=portlets.abc.AbcController,scope=request,type=org.apache.beehive.netui.pageflow.internal.FlowControllerAction,validate=false,cancellable=false,
    ActionForm=null,
    Request=or[email protected]1227f7a,
    Response=org.ap[email protected]1df284c&gt;
    &lt;Trace&gt;
    &lt;org.apache.beehive.netui.pageflow.FlowController&gt; &lt;No expression
    evaluated to true on simple action /begin; using forward _defaultForward.&gt;

    &lt;Debug&gt;
    &lt;org.apache.beehive.netui.pageflow.internal.DefaultActionForwardHandler&gt; &lt;Forwarding
    to /index.faces&gt;

    &lt;Debug&gt;
    &lt;org.apache.beehive.netui.pageflow.DefaultPageFlowEventReporter&gt; &lt;actionSuccess:
    [email protected], ActionMapping=ActionConfig[path=/begin,parameter=portlets.abc.AbcController,scope=request,type=org.apache.beehive.netui.pageflow.internal.FlowControllerAction,validate=false,cancellable=false,
    ActionForm=null, Request=or[email protected]1227f7a,
    Response=org.ap[email protected]1df284c,
    ActionForward=ForwardConfig[name=_defaultForward,path=/index.faces,redirect=false,contextRelative=false,module=null],
    TimeTakenMillis=0&gt;

    &lt;Debug&gt;
    &lt;org.apache.beehive.netui.pageflow.PageFlowRequestProcessor&gt; &lt;processForwardConfig(ForwardConfig[name=_defaultForward,path=/index.faces,redirect=false,contextRelative=false,module=null])&gt;
    &lt;Trace&gt;
    &lt;org.apache.beehive.netui.pageflow.internal.DeferredSessionStorageHandler&gt;
    &lt;getAttribute: portletsabc_AbcController_portlet_netui:nestingStack&gt;

    &lt;Debug&gt;
    &lt;org.apache.beehive.netui.pageflow.internal.DeferredSessionStorageHandler&gt;
    &lt;Applying changes for request
    /ParticipantPortalWeb/portlets/abc/AbcController.portlet. Identity: 2169848&gt;

    &lt;Debug&gt;
    &lt;org.apache.beehive.netui.util.internal.ServletUtils&gt; &lt;Using session
    lock of type: class
    org.apache.beehive.netui.pageflow.HttpSessionMutexListener$Mutex&gt;

    &lt;Trace&gt; &lt;org.apache.beehive.netui.pageflow.internal.DeferredSessionStorageHandler&gt;
    &lt;Removing attribute portletsabc_AbcController_portlet_netui:facesBacking
    from the session.&gt;

    &lt;Debug&gt;
    &lt;org.apache.beehive.netui.pageflow.internal.DeferredSessionStorageHandler&gt;
    &lt;Completed applying changes for request
    /ParticipantPortalWeb/portlets/abc/AbcController.portlet. Identity: 2169848&gt;

    &lt;Debug&gt; &lt;org.apache.beehive.netui.pageflow.DefaultPageFlowEventReporter&gt;
    &lt;endActionRequest: Request=or[email protected]1227f7a,
    Response=org.ap[email protected]1df284c,
    TimeTakenMillis=0&gt;

    &lt;Trace&gt;
    &lt;org.apache.beehive.netui.pageflow.PageFlowRequestProcessor&gt; &lt;--------------------------------
    End Request #7 ------------------------------------&gt;

    To sum up what I tried so far:
    # New JPF Portlet wizard with existing Page Flow (also created with wizard) with the initial page being a JSP Faces; NO PORTLET CONTENT generated
    # New JPF Portlet wizard with no Page Flow: in this case the initial page is a regular NetUI JSP page. I turned the page into a Faces page as explained in my previous post. NO PORTLET CONTENT generated
    # A JPF Portlet with a Page Flow using a regular NetUI page works.
    On both unsuccessful cases no content was generated for the portlet but the page flow ran correctly.
    May I conclude that Faces support is flawed?
  • Has anyone been able to reproduce the issue that I described in my second post?
  • I`m beginning to realize that:
    1) Nobody here will bother to try to reproduce my situation and
    2) The symptom I described may actually indicate a bug in WLP 10.x product.
  • 661716
    661716 Member Posts: 4
    I`m beginning to realize that:
    1) Nobody here will bother to try to reproduce my situation and
    Yep, it can sometimes be difficult to get volunteers to do stuff for you.

    However, I did try and got the same result. I didn't see any obvious workaround, but I'll ping the portal framework devs and see if they have any ideas.
    2) The symptom I described may actually indicate a bug in WLP 10.x product.
    Have you opened a support case? That would be my recommendation.
  • Dave Landers wrote:
    2) The symptom I described may actually indicate a bug in WLP 10.x product.
    Have you opened a support case? That would be my recommendation.
    Where? How?
This discussion has been closed.