index.jsp

 


 <%--
 --%>
 
 <%@ page import="converterApp.ConverterBean,java.math.*" %>
 <%@ page contentType="text/html; charset=ISO-8859-5" %>
       
 <html>
 <head>
 
  <title>Currency Conversion Application</title>
 </head>
 
 <body bgcolor="white">
 
 <jsp:useBean id="converter" class="converterApp.ConverterBean"/> 
 
 
 
 <h1>Currency Conversion Application JSP page</h1>
 
 <p><hr>
 
 <p>Enter an amount to convert:</p>
 <form method="get">
 <input type="text" name="amount">
 
 <p>
 <input type="submit" value="Submit">
 <input type="reset" value="Reset">
 </form>
 <%
  String amount = request.getParameter("amount");
 
 if ( amount != null && amount.length() > 0 ) {
 
 %>
 <p><p><%= amount %> dollars are  
 
 <jsp:setProperty name="converter" property="yenAmount" value="<%= new BigDecimal(amount)%>" />
 <jsp:getProperty name="converter" property="yenAmount"  /> Yen. 
 
 <p><%= amount %> Yen are
 
 <jsp:setProperty name="converter" property="euroAmount" value="<%= new BigDecimal(amount)%>" />
 <jsp:getProperty name="converter" property="euroAmount"  /> Euro. 
 
 <% 
 } 
 %>
 
 </body>
 </html>