summaryrefslogtreecommitdiffstats
path: root/sandbox/travelsample/contributions/currency-jsp-contribution/src/main/webapp/currency-converter.jsp
diff options
context:
space:
mode:
authormcombellack <mcombellack@13f79535-47bb-0310-9956-ffa450edef68>2009-07-12 22:22:41 +0000
committermcombellack <mcombellack@13f79535-47bb-0310-9956-ffa450edef68>2009-07-12 22:22:41 +0000
commit0972a2480e2ec5997599645ca99c7621464c07ce (patch)
tree36bb003469330789c5d8a428e1666b1b0b4236e8 /sandbox/travelsample/contributions/currency-jsp-contribution/src/main/webapp/currency-converter.jsp
parentd6feddc44be39354f939106f6b94530e039af3e7 (diff)
Initial commit of a JSP currency converter
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@793419 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--sandbox/travelsample/contributions/currency-jsp-contribution/src/main/webapp/currency-converter.jsp49
1 files changed, 49 insertions, 0 deletions
diff --git a/sandbox/travelsample/contributions/currency-jsp-contribution/src/main/webapp/currency-converter.jsp b/sandbox/travelsample/contributions/currency-jsp-contribution/src/main/webapp/currency-converter.jsp
new file mode 100644
index 0000000000..0014492edb
--- /dev/null
+++ b/sandbox/travelsample/contributions/currency-jsp-contribution/src/main/webapp/currency-converter.jsp
@@ -0,0 +1,49 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="http://www.osoa.org/sca/sca_jsp.tld" prefix="sca" %>
+
+<sca:reference name="currencyConverter" type="scatours.currencyconverter.CurrencyConverter"/>
+
+<html>
+<body>
+<h2>SCA Tours Currency Converter</h2>
+Welcome to the SCA Tours Currency Converter:
+<p>
+
+<form method=post action="currency-converter.jsp">
+Enter value in US Dollars
+<input type=text name=dollars size=15>
+<p>
+<input type=submit>
+</form>
+
+<p>
+
+<%
+ String dollarsStr = request.getParameter( "dollars" );
+ if ( dollarsStr != null) {
+ double dollars = Double.parseDouble(dollarsStr);
+ double converted = currencyConverter.convert("USD", "GBP", dollars);
+ out.println(dollars + " US Dollars = " + converted + " GB Pounds");
+ }
+%>
+</body>
+</html>
+