Re: Correct "Logout" Action
Re: Correct "Logout" Action
- Subject: Re: Correct "Logout" Action
- From: Chuck Hill <email@hidden>
- Date: Tue, 29 Jul 2003 11:04:34 -0700
- Organization: Global Village Consulting, Inc.
If not using D2W you can set the redirect like this:
public WOComponent logout() {
session().terminate();
WORedirect mainPage = (WORedirect) pageWithName("WORedirect");
mainPage.setUrl(
context().directActionURLForActionNamed(
"default", new NSDictionary(Boolean.FALSE, "wosid")));
return mainPage;
}
Chuck
Giorgio Valoti wrote:
On Martedl, lug 29, 2003, at 12:44 Europe/Rome, Goodbye Bill wrote:
What is the correct (aka "preferred") method of providing a "Logout"
function to the end user? Does one simply call a "dispose" on the
editing
context? Maybe the session's "terminate" method?
I usually do something like this in the Session class.
public WOComponent logout() {
//<http://developer.apple.com/documentation/WebObjects/Reference/API/
com/webobjects/appserver/WOSession.html#terminate()>
terminate();
//<http://developer.apple.com/documentation/WebObjects/Reference/API/
com/webobjects/appserver/WORedirect.html>
WOComponent redirectPage =
WOApplication.application().pageWithName( "WORedirect", context() );
//
<http://developer.apple.com/documentation/WebObjects/Reference/API/com/
webobjects/directtoweb/
D2W.html#homeHrefInContext(com.webobjects.appserver.WOContext)>
( (WORedirect)redirectPage ).setUrl(
D2W.factory().homeHrefInContext( context() ) );
return redirectPage;
}
--
Giorgio Valoti
-------------
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
Progress is the mother of all problems.
- G. K. Chesterton
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.