You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jb...@apache.org on 2006/09/10 21:15:26 UTC
svn commit: r441990 - in
/incubator/tuscany/java/samples/sca/webapp/src/main: java/calculator/
java/calculator/CalculatorClient.java webapp/WEB-INF/default.scdl
webapp/WEB-INF/web.xml webapp/calc.jsp
Author: jboynes
Date: Sun Sep 10 12:15:25 2006
New Revision: 441990
URL: http://svn.apache.org/viewvc?view=rev&rev=441990
Log:
use calculator components in simple webapp sample
Added:
incubator/tuscany/java/samples/sca/webapp/src/main/java/calculator/
- copied from r441960, incubator/tuscany/java/samples/sca/calculator/src/main/java/calculator/
incubator/tuscany/java/samples/sca/webapp/src/main/webapp/WEB-INF/default.scdl
- copied unchanged from r441960, incubator/tuscany/java/samples/sca/calculator/src/main/resources/META-INF/sca/default.scdl
incubator/tuscany/java/samples/sca/webapp/src/main/webapp/calc.jsp
Removed:
incubator/tuscany/java/samples/sca/webapp/src/main/java/calculator/CalculatorClient.java
Modified:
incubator/tuscany/java/samples/sca/webapp/src/main/webapp/WEB-INF/web.xml
Modified: incubator/tuscany/java/samples/sca/webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/webapp/src/main/webapp/WEB-INF/web.xml?view=diff&rev=441990&r1=441989&r2=441990
==============================================================================
--- incubator/tuscany/java/samples/sca/webapp/src/main/webapp/WEB-INF/web.xml (original)
+++ incubator/tuscany/java/samples/sca/webapp/src/main/webapp/WEB-INF/web.xml Sun Sep 10 12:15:25 2006
@@ -5,6 +5,17 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
+ <display-name>Apache Tuscany Simple Webapp Sample</display-name>
+
+ <filter>
+ <filter-name>TuscanyFilter</filter-name>
+ <filter-class>org.apache.tuscany.runtime.webapp.TuscanyFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>TuscanyFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
<listener>
<listener-class>org.apache.tuscany.runtime.webapp.TuscanyContextListener</listener-class>
</listener>
Added: incubator/tuscany/java/samples/sca/webapp/src/main/webapp/calc.jsp
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/webapp/src/main/webapp/calc.jsp?view=auto&rev=441990
==============================================================================
--- incubator/tuscany/java/samples/sca/webapp/src/main/webapp/calc.jsp (added)
+++ incubator/tuscany/java/samples/sca/webapp/src/main/webapp/calc.jsp Sun Sep 10 12:15:25 2006
@@ -0,0 +1,43 @@
+<%@ page import="calculator.CalculatorService" %>
+<%@ page import="org.osoa.sca.CompositeContext" %>
+<%@ page import="org.osoa.sca.CurrentCompositeContext" %>
+<%--
+ * 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" %>
+<%
+ CompositeContext context = CurrentCompositeContext.getContext();
+ CalculatorService calc = context.locateService(CalculatorService.class, "CalculatorServiceComponent");
+%>
+<html>
+<head><title>Calculator sample</title></head>
+
+<body>
+<table>
+ <tr>
+ <th>Expression</th><th>Result</th>
+ </tr>
+ <tr>
+ <td>2 + 3</td><td><%= calc.add(2, 3) %></td>
+ </tr>
+ <tr>
+ <td>3 - 2</td><td><%= calc.subtract(3, 2) %></td>
+ </tr>
+</table>
+</body>
+</html>
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org