You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by ta...@jakarta.apache.org on 2004/10/14 19:48:10 UTC

[Jakarta Tapestry Wiki] Updated: FrequentlyAskedQuestions/LogoutLink

   Date: 2004-10-14T10:48:10
   Editor: SteveGibson <st...@cowww.com>
   Wiki: Jakarta Tapestry Wiki
   Page: FrequentlyAskedQuestions/LogoutLink
   URL: http://wiki.apache.org/jakarta-tapestry/FrequentlyAskedQuestions/LogoutLink

   Reformat a little, put simple case first

Change Log:

------------------------------------------------------------------------------
@@ -3,6 +3,16 @@
 [http://article.gmane.org/gmane.comp.java.tapestry.user/8108]
 I have simplified it, though the functionality will be identical under 3.0.
 
+= Simple Answer =
+Use a ServiceLink to the RestartService in your page(.html).
+{{{
+    <span jwcid="@ServiceLink" service="ognl:@org.apache.tapestry.Tapestry@RESTART_SERVICE">Logout</span>
+}}}
+
+This will save on writing extra classes if you don't need them, but stops you from doing other things in your listener without wrapping the Restart Service (like logging a message, giving the user the option to not logout?, etc).
+
+= Listener Approach =
+
 Firstly, you will need to define a listener method in your page class.
 ----
 ''For newbies:''
@@ -10,7 +20,7 @@
     1. Add listener method public void logout(IRequestCycle cycle) 
     You can use any method name, just keep the signature the same. IRequestCycle is org.apache.tapestry.IRequestCycle
     1. Change page definition (.page) so that your page-specification has class set to your new class. 
-''NB: IEngine is org.apache.tapestry.IEngine ''
+''NB: IEngine is org.apache.tapestry.IEngine '' 
 ----
 
 Inside the listener method, 
@@ -29,11 +39,4 @@
 {{{
    <span jwcid="@ActionLink" listener="ognl:listeners.logout">Logout</span>
 }}}
-----
-Another (even simpler) approache is to use a ServiceLink to the RestartService.
-{{{
-    <span jwcid="@ServiceLink" service="ognl:@org.apache.tapestry.Tapestry@RESTART_SERVICE">Logout</span>
-}}}
 
-This will save on the extra class if you don't need it, but stops you from doing other things in your listener without wrapping the Restart Service (like logging a message, giving the user the option to not logout?, etc).
-----

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