Advertisement
Guest User

Untitled

a guest
Oct 26th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.74 KB | None | 0 0
  1. package valid;
  2.  
  3. import javax.inject.Named;
  4. import javax.enterprise.context.SessionScoped;
  5. import java.io.Serializable;
  6.  
  7.  
  8. @Named(value = "valid")
  9. @SessionScoped
  10. public class valid implements Serializable {
  11.  
  12.     String Name;
  13.     String Password;
  14.  
  15.     public String getName() {
  16.         return Name;
  17.     }
  18.  
  19.     public void setName(String Name) {
  20.         this.Name = Name;
  21.     }
  22.  
  23.     public String getPassword() {
  24.         return Password;
  25.     }
  26.  
  27.     public void setPassword(String Password) {
  28.         this.Password = Password;
  29.     }
  30.    
  31.     public valid() {
  32.     }  
  33. }
  34. --------------------------------
  35. <?xml version='1.0' encoding='UTF-8' ?>
  36. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  37. <html xmlns="http://www.w3.org/1999/xhtml"
  38.       xmlns:h="http://xmlns.jcp.org/jsf/html">
  39.     <h:head>
  40.         <title>Login</title>
  41.     </h:head>
  42.     <h:body>
  43.         <h:form>
  44.         UserName:<h:inputText value="#{valid.Name}"/><br />
  45.         Password:<h:inputSecret value="#{valid.Password}"/><br />
  46.         <h:commandButton value="submit" action="welcome.xhtml"/>
  47.      </h:form>
  48.     </h:body>
  49. </html>
  50.  
  51. -----------------------------------------
  52. <?xml version="1.0" encoding="UTF-8"?>
  53. <!--
  54. To change this license header, choose License Headers in Project Properties.
  55. To change this template file, choose Tools | Templates
  56. and open the template in the editor.
  57. -->
  58. <!DOCTYPE html>
  59. <html xmlns="http://www.w3.org/1999/xhtml">
  60.     <head>
  61.         <title>First Site </title>
  62.         <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  63.     </head>
  64.     <body>
  65.         <div>Welcome to JavaServer Faces #{valid.Name}</div>
  66.     </body>
  67. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement