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

Alexander Kolesnikov

"Tapestry 5: Building Web Applications"

packtpub.celebrities.pages;
import com.packtpub.celebrities.model.Celebrity;
import org.apache.tapestry.annotations.Persist;
import java.text.Format;
public class Details
{
@Persist
private Celebrity celebrity;
public void setCelebrity(Celebrity c)
{
this.celebrity = c;
}
public Celebrity getCelebrity()
{
return celebrity;
}
public Format getDateFormat()
{
return Formats.getDateFormat();
}
}
Simple Components
[ 104 ]
You can run the application now, click on a celebrity's last name and see his or her
details displayed on the Details page.
Let's suppose that you were so impressed by a celebrity that you decided to
bookmark the Details page to come and see it later. Let's do this for real, display the
details for some celebrity and bookmark the page. Then close the browser window,
open another one and try to navigate to the bookmark you have just added. You will
get a NullPointerException, and the reason for it is that the celebrity property
of the Details page is null. This is because a persistent property like celebrity is
stored into the session, and by closing the browser window you have invalidated
your current session. In other words, you have forced Tapestry to forget which
celebrity you were dealing with.


Pages:
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6