tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Tapestry Wiki] Update of "Tapestry5LinkingToNonTapestryURIs" by DavidPeterson
Date Tue, 05 Jun 2007 19:57:36 GMT
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


Mime
View raw message