Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
- <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
- <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Calculator</title>
- </head>
- <body>
- <f:view>
- <h:form>
- <h:outputLabel for = "resultInput" value="result"></h:outputLabel>
- <h:inputText id = "resultInput" value="#{calculator.result}"></h:inputText>
- <br/>
- <br/>
- <h:commandButton action="#{calculator.numberButtonClick(1)}" value="1"></h:commandButton>
- <h:commandButton action="#{calculator.numberButtonClick(2)}" value="2"></h:commandButton>
- <h:commandButton action="#{calculator.numberButtonClick(3)}" value="3"></h:commandButton>
- <br/>
- <br/>
- <h:commandButton action="#{calculator.numberButtonClick(4)}" value="4"></h:commandButton>
- <h:commandButton action="#{calculator.numberButtonClick(5)}" value="5"></h:commandButton>
- <h:commandButton action="#{calculator.numberButtonClick(6)}" value="6"></h:commandButton>
- <br/>
- <br/>
- <h:commandButton action="#{calculator.numberButtonClick(7)}" value="7"></h:commandButton>
- <h:commandButton action="#{calculator.numberButtonClick(8)}" value="8"></h:commandButton>
- <h:commandButton action="#{calculator.numberButtonClick(9)}" value="9"></h:commandButton>
- <h:commandButton action="#{calculator.numberButtonClick(0)}" value="0"></h:commandButton>
- <br/>
- <br/>
- <h:commandButton action="#{calculator.operationButtonClicked(calculator.PLUS)}" value="+"></h:commandButton>
- <h:commandButton action="#{calculator.operationButtonClicked(calculator.MINUS)}" value="-"></h:commandButton>
- <h:commandButton action="#{calculator.operationButtonClicked(calculator.MULTIPLY)}" value="*"></h:commandButton>
- <h:commandButton action="#{calculator.operationButtonClicked(calculator.DIVIDE)}" value="/"></h:commandButton>
- <h:commandButton action="#{calculator.performCalculation}" value="="></h:commandButton>
- <br/>
- <br/>
- <h:commandButton action="#{calculator.reset}" value="clear"></h:commandButton>
- <br/>
- <br/>
- </h:form>
- </f:view>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement