Changes for page Development-WO Session

Last modified by Pascal Robert on 2010/09/19 10:31

From version 2.1
edited by smmccraw
on 2007/07/08 09:46
Change comment: There is no comment for this version
To version 3.1
edited by Quinton Dolan
on 2007/07/12 20:01
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.smmccraw
1 +XWiki.qdolan
Content
... ... @@ -4,11 +4,11 @@
4 4  
5 5  == Accessing the Session ==
6 6  
7 -{{panel}}
7 +{{code}}
8 8  
9 - Session session = (Session)session();
9 +Session session = (Session)session();
10 10  
11 -{{/panel}}
11 +{{/code}}
12 12  
13 13  Note that this works only in WOComponent or WODirectAction subclasses. If you want to access the session from elsewhere, pick an answer from this list:
14 14  
... ... @@ -23,13 +23,13 @@
23 23  
24 24  If you like to simplify your code just insert the following method in your component (this will save you some typing):
25 25  
26 -{{panel}}
26 +{{code}}
27 27  
28 - public Session Session() {
29 - return (Session)this.session();
30 - }
28 +public Session Session() {
29 + return (Session)this.session();
30 +}
31 31  
32 -{{/panel}}
32 +{{/code}}
33 33  
34 34  We always begin our projects with a WOComponent subclass that we use as a superclass for all the rest of our components. We include this method as well as a few other useful utility methods. --- JoshuaMarker--
35 35  
... ... @@ -63,11 +63,11 @@
63 63  
64 64  If you are in a DirectAction method when trying to do this, check the following WOAction method (WOAction is WODirectAction's superclass):
65 65  
66 -{{panel}}
66 +{{code}}
67 67  
68 - public WOSession existingSession()
68 +public WOSession existingSession()
69 69  
70 -{{/panel}}
70 +{{/code}}
71 71  
72 72  Restores the session based on the request. If the request did not have a session ID or the session ID referred to a non-existent session, then this method returns null. To determine if a session failed to restore, check the request's session ID to see if it non-null and if so, call this method to check its result.
73 73  
... ... @@ -76,11 +76,11 @@
76 76  
77 77  If you're not in a DirectAction method, look at WOContext's method:
78 78  
79 -{{panel}}
79 +{{code}}
80 80  
81 - public boolean hasSession()
81 +public boolean hasSession()
82 82  
83 -{{/panel}}
83 +{{/code}}
84 84  
85 85  Returns true if a session exists for the receiving context, false otherwise.
86 86