You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Apache Wiki <wi...@apache.org> on 2007/06/05 21:57:36 UTC

[Tapestry Wiki] Update of "Tapestry5LinkingToNonTapestryURIs" by DavidPeterson

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tapestry Wiki" for change notification.

The following page has been changed by DavidPeterson:
http://wiki.apache.org/tapestry/Tapestry5LinkingToNonTapestryURIs

New page:
When integrating Acegi security, you need to redirect login and logouts to Acegi's special URIs. You can do this from Tapestry by returning a Link object constructed using the encoder from the response, the context path from the request and the appropriate URI and parameters.

== Example ==

{{{
import org.apache.tapestry.internal.services.LinkImpl;
import org.apache.tapestry.services.Request;
import org.apache.tapestry.services.Response;

public class Login {
    @Inject
    private Request request;
    
    @Inject
    private Response response;

    Link onSuccessFromLoginForm() {
        Link link= new LinkImpl(response, request.getContextPath(), "j_acegi_security_check");
        link.addParameter("j_username", username);
        link.addParameter("j_password", password);
        return link;
    }
}}}

''Small word of caution:'' For convenience we're using the internal class [http://tapestry.apache.org/tapestry5/tapestry-core/apidocs/org/apache/tapestry/internal/services/LinkImpl.html LinkImpl]. Although it's unlikely to change much, you may prefer to write your own implementation of the Link interface.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org