SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 85 | Next

Alexander Kolesnikov

"Tapestry 5: Building Web Applications"

passedMessage = passedMessage;
}
void onActivate(String message)
{
System.out.println("Another page is activated! The
message is: " + message);
this.passedMessage = message;
}
String onPassivate()
{
System.out.println("Another page is passivated...");
return passedMessage;
}
}
Now let's run the application and see what happens. Enter some message into the
text box at the Start page, and click on the Submit button. The Another page will
appear with the message displayed properly, while in the console we shall see the
following output:
Setting the message: hi there!
Handling form submission!
Another page is passivated...
Another page is activated! The message is: hi there!
Chapter 3
[ 67 ]
Let's see what has happened here. In the code of the Start page, we have used an
injected instance of the Another page to set a message on it. Then we asked Tapestry
to show the Another page which, as we've seen before, would normally mean
wiping out the message (perhaps by sending the instance we have just used back
to the pool) and displaying a fresh empty instance of the Another page, perhaps
just taken from the pool. However, before sending the first instance back to the
pool, Tapestry will check whether the Another page uses the activation context
by implementing the pair of methods, onActivate and onPassivate.


Pages:
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6