You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by SWC <ma...@crissman.net> on 2004/01/05 13:41:22 UTC
Re: Service Callback
Well, I've since gotten around this issue by changing the service into
a page, and using an external link to the page with a PageCallback.
This is fairly inelegant, and I still feel like there should be some
sort of service callback that I am missing somewhere, but if anyone is
facing a similar issue, the above solution may work for you as well.
- Spencer
On Dec 29, 2003, at 8:11 PM, SWC wrote:
> Perhaps I was not clear:
> I was able to implement the validation you mention using a method
> quite similar to the one you have detailed. I also set up a callback
> routine so that once the user does login, they will be taken back to
> the page they initially tried to get to. I wish to perform the same
> funtionality within my service, however.
>
> I already validate the user within the service, and have no problem
> referring him back to the user login page if he is not logged in.
> What I am not having success with is how to set a callback to the
> service such that when the user has successfully logged in, they are
> automatically returned to the service which they initially tried to
> access, with the same parameters as were initially passed in (prior to
> being validated). From pages, I make user of PageCallback and the
> ICallback interface. Is it possible to achieve something similar for
> services?
>
> Thanks for any ideas,
>
> Spencer
>
> On Dec 29, 2003, at 5:45 PM, Mark Alcocer Flores wrote:
>
>> You could do something like this:
>>
>> public void pageValidate(PageEvent event) {
>> Visit visit = (Visit) getEngine().getVisit();
>>
>> if ((visit != null && visit.isUserLoggedIn()))
>> return;
>>
>> Home login =
>> (Home)getRequestCycle().getPage("Home");
>> throw new PageRedirectException(login);
>> }
>>
>> you must implement the interface PageValidateListener.
>> The exception redirects the user to the page you need.
>>
>> --- SWC <ma...@crissman.net> wrote:
>>> I have a protected service, which takes a single
>>> parameter. I would
>>> like to set up a callback so that user's who try to
>>> access the service
>>> without being logged in are referred to the Login
>>> page.
>>>
>>> I was able to implement a similar functionality for
>>> my protected pages
>>> using the ICallback interface and the technique
>>> discussed on the list
>>> recently. I have not been able to implement the
>>> service callback,
>>> however. Can anyone give me a pointer as to how to
>>> go about doing
>>> this? It seems as though it should be quite simple,
>>> however I have had
>>> no luck at all with its implementation.
>>>
>>> Thanks for your help,
>>>
>>> Spencer
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:
>>> tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>>> tapestry-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org