[Opensource] Transition questions!

larry hamel expresso at codeguild.com
Wed Jun 18 19:18:19 PDT 2003


Well, this makes it clear that transitions are not clear enough :-)

Indeed there is a way, and to make it more clear, I just added the following convenience method to Controller.java

you can use the two line implementation of this method right now to transition to an "external" controller.

    /**
     * convenience method for transition to other controller
     */
    protected void transition(String newState, Class externalController, ControllerRequest req,
                              ControllerResponse res)
            throws ControllerException, NonHandleableException {

        Transition trans = new Transition("", "", externalController, newState);
        trans.transition(req, res);
    }

Larry


At 04:36 PM 6/18/2003, Salvador Cadena Roa wrote:
>Hi Tino,
> 
>As you can see there is no way to make a transition between
>two different controllers.
> 
>You maybe need to review your project design, in order to
>have all the states associated with a controller in the same 
>controller.
> 
>However, I guess there is a way to change to another controller
>I haven't tried and I don't know if this is an elegant way, but
>maybe you could try this.
> 
> 
> 
>yourOtherController otherController = new yourOtherController();
>
>ControllerResponse myNewResponse = othercontroller.runpromptLoginState(request,response);
>return myNewResponse;
> 
>As you can see, this way you are invoking another class, but the control
>still returns tu your current controller.
> 
>Hope this could help, However, I recommend that you review your project design.
> 
>Best regards.
> 
>I don't know if this is a 
>----- Original Message ----- 
>From: "Tino Dai" <<mailto:tdai at optonline.net>tdai at optonline.net>
>To: <<mailto:opensource at jcorporate.com>opensource at jcorporate.com>
>Sent: Wednesday, June 18, 2003 4:27 PM
>Subject: [Opensource] Transition questions!
>
>> Hi Everybody,
>> 
>>    I have hit a snag. I have a part of my controller code that I want to
>> automatically transition to another method in another controller. Right
>> now, I can do this:
>> 
>>    transition("promptLogin",request,response);
>> 
>> but I am kinda at a loss for how to get it to go to another class. Can
>> anybody shed some light on this?
>> 
>> -Tino
>> 
>> 
>> 
>> 
>> _______________________________________________
>> Opensource mailing list
>> <mailto:Opensource at jcorporate.com>Opensource at jcorporate.com
>> http://mail.jcorporate.com/mailman/listinfo/opensource
>> Archives: <http://mail.jcorporate.com/pipermail/opensource/>http://mail.jcorporate.com/pipermail/opensource/ 




More information about the Opensource mailing list