now proceed to create our Bean. We
Sources are located in
Packages
to right click and select -> New -> Java Package
right click, select New-> Other
We indicate the name: Login and Scope: Session (for which the value is maintained throughout the user session)
We created bean
javax.faces.bean . SessionScoped;
SessionScoped
public class Login {
add two String attributes
right-click with your mouse and select Insert Code or press the key combination ALT + INS
select Getters and Setters
The IDE generates get and set methods for each field
avbravo.beans package; /**
* @ManagedBean
@SessionScoped
public class Login {
String username;
String password;
public void setPassword(String password) {
this.password = password;
}
public String getUsername() {
Edit the
Agregamps In value = "" add # {and activates the wizard allows you to select
class
repeat the same procedure for password.
In the next blog will create a page that will display the data sent by the user and stored in the Login class
0 comments:
Post a Comment