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

Alexander Kolesnikov

"Tapestry 5: Building Web Applications"

Usually, this is some kind of object we create
specially for the purpose of storing some set of data in an organized way. Say, we
can have a User class for storing information about the application's user. It can be as
simple as this:
package com.packtpub.t5first.util;
public class User
{
private String firstName = "John";
private String lastName = "Smith";
public String getFirstName()
{
return firstName;
}
public void setFirstName(String firstName)
{
this.firstName = firstName;
}
public String getLastName()
{
return lastName;
}
public void setLastName(String lastName)
{
this.lastName = lastName;
}
}
The Foundations of Tapestry
[ 74 ]
Note that I have placed this class into com.packtpub.t5first.util
package. Please remember that you should never place anything but page
classes into the pages sub package (such as com.packtpub.t5first.
pages in this application).
Go on and create such packages and the class. For simplicity's sake, it contains
only first and last names of the user, but we could put as much information as we
might find necessary in this class. We have also initialized the properties to some
default values.
All we need to make an instance of this class available to the whole application is
to create a private field of the type User and mark it with the @ApplicationState
annotation.


Pages:
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
druga wojna światowa Free English grammar and study guid hotel jelenia góra Russian bride counter strike 1.6