Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package valid;
- import javax.inject.Named;
- import javax.enterprise.context.SessionScoped;
- import java.io.Serializable;
- @Named(value = "valid")
- @SessionScoped
- public class valid implements Serializable {
- String Name;
- String Password;
- public String getName() {
- return Name;
- }
- public void setName(String Name) {
- this.Name = Name;
- }
- public String getPassword() {
- return Password;
- }
- public void setPassword(String Password) {
- this.Password = Password;
- }
- public valid() {
- }
- }
- --------------------------------
- <?xml version='1.0' encoding='UTF-8' ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://xmlns.jcp.org/jsf/html">
- <h:head>
- <title>Login</title>
- </h:head>
- <h:body>
- <h:form>
- UserName:<h:inputText value="#{valid.Name}"/><br />
- Password:<h:inputSecret value="#{valid.Password}"/><br />
- <h:commandButton value="submit" action="welcome.xhtml"/>
- </h:form>
- </h:body>
- </html>
- -----------------------------------------
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- To change this license header, choose License Headers in Project Properties.
- To change this template file, choose Tools | Templates
- and open the template in the editor.
- -->
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>First Site </title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
- </head>
- <body>
- <div>Welcome to JavaServer Faces #{valid.Name}</div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement