You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@beehive.apache.org by Jack Rudnick <jr...@bea.com> on 2005/11/09 23:20:25 UTC

pageflow question...

I am working with someone that has the following issue - can you all
please give me somethoughts on this one?

 

------------------------------------------------------------------------
------------------------------------------------------------------------
------------------

A pageflow is entered at the begin method:

 

@Jpf.Action(forwards = { 

    @Jpf.Forward(name = "success_mail", path = "messageDetails.jsp", 

        outputFormBeanType = ObjectA.class ),

    @Jpf.Forward(name = "success_read_report", path =
"messageDetails.jsp", 

        outputFormBeanType = ObjectB.class )        

    } )

protected   Forward begin

(

ObjectA    form

)

 

Depending on what happens during the method, I will need to pass on an
instance of ObjectA or ObjectB to my JSP. ObjectB extends ObjectA. At
the end of my begin action, I have the following statement:

 

    if( form instanceof ObjectB )

        {

        return new Forward( "success_read_report",  form );

        }

    else

        return new Forward( "success_mail", form );

 

The problem is that when I get to my JSP, all of the fields in my form
are empty if I passed in the instance of ObjectB. If I pass ObjectA,
then everything's fine. It's almost like it really, really wants an
instance of ObjectA and if it doesn't get one, it re-instantiates the
form bean. I have even tried the following:

 

    if( form instanceof ReadReport )

        {

        ObjectB objectB = new ObjectB();

        objectB.setSubject("Test");

        return new Forward( "success_read_report", objectB );

        }

    else

        return new Forward( "success_mail", form );

 

But that still doesn't work. I'm thinking that because I enter the
pageflow begin action with a parameter of ObjectA, that's locking me in.
Any ideas here?