You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bryan Hunt <ad...@revoltingdigits.com> on 2004/06/23 14:35:54 UTC

returning to the calling page

Hi ,

I have the following action
http://localhost:8080/jestate-jsp/client-property-view-for-rent-action.do?id=1

On this page I have a form for adding a house to the shopping basket.

The shopping basket is displayed all the time on the left side of the site.

When someone calls this action ( client-add-to-basket.do ) I wanted the 
house
to be added to the basket and then have them bounce back to the original 
page.

I did try this approach ....

if (mapping.getInput() != null) {
            //          return new ActionForward(mapping.getInput());
            return mapping.getInputForward();
        } else //we're fucked ! 
            {
                System.out.println("we're fscked !!!!");
            return null;
        }

..... but it didn't seem to work, I believe I would have to specify the 
input in the struts config
file and I intend for this page to be called from any page in the 
application.

Anyone got any suggestions ?

--b


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: returning to the calling page

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
LOL -- Did you notice my name, Brian?  No worries!

At 07:06 AM 6/23/2004, you wrote:
>sorry i'm irish, we curse a lot. slaps self on wrist ....
>
>--b
>
>Michael McGrady wrote:
>
>>I really hate to have to address this, Brian, but this language is 
>>clearly inappropriate for a public forum.
>>
>>Michael
>>
>>At 05:35 AM 6/23/2004, you wrote:
>>
>>>Hi ,
>>>
>>>I have the following action
>>>http://localhost:8080/jestate-jsp/client-property-view-for-rent-action.do?id=1 
>>>
>>>
>>>On this page I have a form for adding a house to the shopping basket.
>>>
>>>The shopping basket is displayed all the time on the left side of the site.
>>>
>>>When someone calls this action ( client-add-to-basket.do ) I wanted the 
>>>house
>>>to be added to the basket and then have them bounce back to the original 
>>>page.
>>>
>>>I did try this approach ....
>>>
>>>if (mapping.getInput() != null) {
>>>            //          return new ActionForward(mapping.getInput());
>>>            return mapping.getInputForward();
>>>        } else //we're fucked !            {
>>>                System.out.println("we're fscked !!!!");
>>>            return null;
>>>        }
>>>
>>>..... but it didn't seem to work, I believe I would have to specify the 
>>>input in the struts config
>>>file and I intend for this page to be called from any page in the 
>>>application.
>>>
>>>Anyone got any suggestions ?
>>>
>>>--b
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>For additional commands, e-mail: user-help@struts.apache.org
>>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: returning to the calling page

Posted by Bryan Hunt <ad...@revoltingdigits.com>.
sorry i'm irish, we curse a lot. slaps self on wrist ....

--b

Michael McGrady wrote:

> I really hate to have to address this, Brian, but this language is 
> clearly inappropriate for a public forum.
>
> Michael
>
> At 05:35 AM 6/23/2004, you wrote:
>
>> Hi ,
>>
>> I have the following action
>> http://localhost:8080/jestate-jsp/client-property-view-for-rent-action.do?id=1 
>>
>>
>> On this page I have a form for adding a house to the shopping basket.
>>
>> The shopping basket is displayed all the time on the left side of the 
>> site.
>>
>> When someone calls this action ( client-add-to-basket.do ) I wanted 
>> the house
>> to be added to the basket and then have them bounce back to the 
>> original page.
>>
>> I did try this approach ....
>>
>> if (mapping.getInput() != null) {
>>            //          return new ActionForward(mapping.getInput());
>>            return mapping.getInputForward();
>>        } else //we're fucked !            {
>>                System.out.println("we're fscked !!!!");
>>            return null;
>>        }
>>
>> ..... but it didn't seem to work, I believe I would have to specify 
>> the input in the struts config
>> file and I intend for this page to be called from any page in the 
>> application.
>>
>> Anyone got any suggestions ?
>>
>> --b
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: returning to the calling page

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
I really hate to have to address this, Brian, but this language is clearly 
inappropriate for a public forum.

Michael

At 05:35 AM 6/23/2004, you wrote:
>Hi ,
>
>I have the following action
>http://localhost:8080/jestate-jsp/client-property-view-for-rent-action.do?id=1
>
>On this page I have a form for adding a house to the shopping basket.
>
>The shopping basket is displayed all the time on the left side of the site.
>
>When someone calls this action ( client-add-to-basket.do ) I wanted the house
>to be added to the basket and then have them bounce back to the original page.
>
>I did try this approach ....
>
>if (mapping.getInput() != null) {
>            //          return new ActionForward(mapping.getInput());
>            return mapping.getInputForward();
>        } else //we're fucked !            {
>                System.out.println("we're fscked !!!!");
>            return null;
>        }
>
>..... but it didn't seem to work, I believe I would have to specify the 
>input in the struts config
>file and I intend for this page to be called from any page in the application.
>
>Anyone got any suggestions ?
>
>--b
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: returning to the calling page

Posted by HG <st...@nospam.websolver.dk>.
Hi Bryan

> ..... but it didn't seem to work, I believe I would have to specify the
> input in the struts config
> file and I intend for this page to be called from any page in the
> application.

Yeps, the input forward fetched by the method mapping.getInputForward() is
the one defined in the Struts config file. That doesn't help you, because
you want the "return-to-action" to be dynamic.

So one possible solution would be to put the name of the action forward path
on the request before calling client-add-to-basket.do,  have the
implementation (Action class) of client-add-to-basket retrieve this from the
request and construct a ActionForward with the right path and return that
instead of a predefined (Struts config) one.

HTH

Henrik


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org