It depends on which service you expect the redirect page to use.
e.g.
If the ExternalService will handle your redirect link, you can use:

String page = "MyPage";
Object[] parameters = new Object[] { parameter1, parameter2 };

// Alternatively, you can use injection to obtain service
IEngineService service =
cycle.getInfrastructure().getServiceMap().getService(Tapestry.EXTERNAL_SERVICE);

ILink link = service.getLink(false, new ExternalServiceParameter(page,
parameters));

Paul

Stephane Decleire wrote:
> Thanks !
>
> And does anybody know how to pass parameters to the ILink ?
>
> Stephane
>
> Filip S. Adamsen a écrit :
>> I think what you want to do is to simply return null if you find any
>> errors. Tapestry won't redirect, then.
>>
>> Stephane Decleire skrev:
>>> Hi,
>>>
>>> I've tried to implement redirect-after-post pattern in Tapestry4
>>> without success ...
>>>
>>> I've read that the way to send a redirect reponse to the client web
>>> browser is to return an ILink from the form listener method like this :
>>>
>>>     @InjectObject("engine-service:page")
>>>     public abstract IEngineService getPageService();
>>>  
>>>     public ILink doFormSubmit()
>>>     {
>>>         // ...
>>>         return getPageService().getLink(false, getPageName());
>>>     }
>>> But I can't return an ILink in my listener if an error is found
>>> during the validation of the form :
>>>
>>>     IValidationDelegate delegate = getValidationDelegate();
>>>     if (delegate.getHasErrors())
>>>         return;
>>>
>>> Did i miss something ? What's the trick ??
>>>
>>> Thanks in advance for any clue.
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to