Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package Validation;
  7. import java.io.Serializable;
  8. import javax.faces.bean.ManagedBean;
  9.  
  10.  
  11. /**
  12. *
  13. * @author 201511081
  14. */
  15. @ManagedBean ( name = "validationBean")
  16. public class ValidationBean implements Serializable{
  17. private String name;
  18. private String email;
  19. private String phone;
  20.  
  21. public String getName()
  22. {
  23. return name;
  24. }
  25.  
  26. public void setName ( String name )
  27. {
  28. this.name = name;
  29. }
  30.  
  31. public String getEmail()
  32. {
  33. return email;
  34. }
  35.  
  36. public void setEmail ( String email )
  37. {
  38. this.email = email;
  39. }
  40.  
  41. public String getPhone()
  42. {
  43. return phone;
  44. }
  45.  
  46. public void setPhone ( String phone )
  47. {
  48. this.phone = phone;
  49. }
  50.  
  51. public String getResult ()
  52. {
  53. if ( name != null && email != null && phone != null)
  54. return "<p style=\"background-color:yellow;width:200px;" +
  55. "padding:5px\">Name: " +getName() + "<br/>E-Mail: "+
  56. getEmail()+"<br/>Phone: " +getPhone() + "</p>";
  57. else
  58. return "";
  59.  
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement