There is another already familiar component on the Start page, PageLink. It is
disguised as a HTML link and specifies which page should be shown when the link
is clicked on:
Or registerTo complete the page, we need to add the required functionality to the page
class??” two properties to contain username and password, and an event handler for
form submission. Let's implement the following logic in the event handler:
The previously created Security class is used to authenticate the user by
checking the submitted information.
If authentication is successful, the authenticate method of Security will
return a User object. We shall save this User as an Application State Object
(ASO) and display the ShowAll page.
??? ???
Simple Components
[ 92 ]
If validation fails, no User is stored as an ASO and the Registration page is
shown instead. This is for the first iteration of the project only. Later, we
are going to redisplay the Start page in such a case, with an appropriate
message on it.
Here is the complete code for the Start page class:
package com.packtpub.celebrities.pages;
import com.packtpub.celebrities.util.Security;
import com.
Pages:
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129