OK, I've got two responses:

    1) You're running into a bug -- ObjectB should work fine.  I've
entered http://issues.apache.org/jira/browse/BEEHIVE-1001 and I'll fix
it today.

    2) If your destination JSP isn't itself submitting a form bean
(i.e., if it's only displaying the data passed from the begin method),
then you could use "action outputs", which are more flexible and avoid
the intricacies of form beans.  There's some doc here:
http://beehive.apache.org/docs/1.0/netui/databinding.html#implicit-objects-netui-pageInput

Rich

Jack Rudnick wrote:

>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?
>
> 
>
>
>  
>

Reply via email to