Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
  2. <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
  3. <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  8. <title>Calculator</title>
  9. </head>
  10. <body>
  11. <f:view>
  12. <h:form>
  13.  
  14. <h:outputLabel for = "resultInput" value="result"></h:outputLabel>
  15. <h:inputText id = "resultInput" value="#{calculator.result}"></h:inputText>
  16.  
  17. <br/>
  18. <br/>
  19. <h:commandButton action="#{calculator.numberButtonClick(1)}" value="1"></h:commandButton>
  20. <h:commandButton action="#{calculator.numberButtonClick(2)}" value="2"></h:commandButton>
  21. <h:commandButton action="#{calculator.numberButtonClick(3)}" value="3"></h:commandButton>
  22. <br/>
  23. <br/>
  24. <h:commandButton action="#{calculator.numberButtonClick(4)}" value="4"></h:commandButton>
  25. <h:commandButton action="#{calculator.numberButtonClick(5)}" value="5"></h:commandButton>
  26. <h:commandButton action="#{calculator.numberButtonClick(6)}" value="6"></h:commandButton>
  27. <br/>
  28. <br/>
  29. <h:commandButton action="#{calculator.numberButtonClick(7)}" value="7"></h:commandButton>
  30. <h:commandButton action="#{calculator.numberButtonClick(8)}" value="8"></h:commandButton>
  31. <h:commandButton action="#{calculator.numberButtonClick(9)}" value="9"></h:commandButton>
  32. <h:commandButton action="#{calculator.numberButtonClick(0)}" value="0"></h:commandButton>
  33. <br/>
  34. <br/>
  35. <h:commandButton action="#{calculator.operationButtonClicked(calculator.PLUS)}" value="+"></h:commandButton>
  36. <h:commandButton action="#{calculator.operationButtonClicked(calculator.MINUS)}" value="-"></h:commandButton>
  37. <h:commandButton action="#{calculator.operationButtonClicked(calculator.MULTIPLY)}" value="*"></h:commandButton>
  38. <h:commandButton action="#{calculator.operationButtonClicked(calculator.DIVIDE)}" value="/"></h:commandButton>
  39.  
  40. <h:commandButton action="#{calculator.performCalculation}" value="="></h:commandButton>
  41. <br/>
  42. <br/>
  43. <h:commandButton action="#{calculator.reset}" value="clear"></h:commandButton>
  44. <br/>
  45. <br/>
  46.  
  47. </h:form>
  48.  
  49. </f:view>
  50. </body>
  51. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement