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 74 | Next

Alexander Kolesnikov

"Tapestry 5: Building Web Applications"

Usually, if we submit some value we
do not want it to be displayed by the same page, but we rather want the application
to do something with this value.
For example, we might want the application to pass the entered message to
another page.
Chapter 3
[ 59 ]
Passing a Value Between Pages
Let's say we want the Another page to display the message we entered at the Start
page. First of all, we need to provide a property to store the passed value. Modify the
Another page class (Another.java file) to look similar to this:
package com.packtpub.t5first.pages;
public class Another
{
private String passedMessage;
public String getPassedMessage()
{
return passedMessage;
}
public void setPassedMessage(String passedMessage)
{
this.passedMessage = passedMessage;
}
}
Next, let's use an expansion to display the passed message at the Another page.
Modify the Another page template to look like this:


Another Page


Another Page


Received a new message: ${passedMessage}



Back to the Start
page




Now we need to write some code to actually pass the message to the Another page.


Pages:
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6