summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-11-11 23:07:07 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-11-11 23:07:07 +0000
commit5559ef5edbf8d3616f7a4b497b2a459b0ee4082b (patch)
tree424dfa28917e6204d4fd24e4328d274f8d2d14d0 /sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp
parent3dd7e2c4da9c80b8182a2d04dc129a67aa7910df (diff)
Moving 1.x branches
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835122 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp')
-rw-r--r--sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/README61
-rw-r--r--sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/build.xml175
-rw-r--r--sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/pom.xml67
-rw-r--r--sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/java/sample/ChatService.java26
-rw-r--r--sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/java/sample/ChatServiceImpl.java36
-rw-r--r--sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/resources/chat.composite40
-rw-r--r--sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/webapp/META-INF/sca-contribution.xml24
-rw-r--r--sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/webapp/WEB-INF/web.xml37
-rw-r--r--sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/webapp/chat.html70
9 files changed, 536 insertions, 0 deletions
diff --git a/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/README b/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/README
new file mode 100644
index 0000000000..dddd7e3f94
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/README
@@ -0,0 +1,61 @@
+Chat WebApp Sample
+==================
+This sample demonstrates the SCA DWR binding to implement the classic Ajax sample
+of a chat application which allows multiple users to chat from their browsers.
+
+The README in the samples directory (the directory above this) provides
+general instructions about building and running samples. Take a look there
+first.
+
+As this sample provides a web app there is a manual step where the WAR file
+that contains the sample is copied to your web app container. If you just want
+to give this sample a go deploy the WAR file (target/sample-chat-webapp.war)
+to your web application server.
+
+Once the web app is deployed use your browser to visit the following URL;
+
+http://localhost:8080/sample-chat-webapp
+
+The port and hostname will of course vary depending on your local installation.
+
+Sample Overview
+---------------
+The sample provides an SCA component which has an SCA service using the SCA DWR
+binding and an SCA reference also using the DWR binding. The component implementation
+simply forwards every invocation of the service as an invocation on the reference. The
+component reference is scoped by the composite so every active client of the composite
+will receive every message sent to the component service, thus implementing the chat
+application with very little code.
+
+chat-webapp/
+ src/
+ main/
+ java/
+ sample/
+ ChatService.java - service interface
+ ChatServiceImpl.java - service implementation
+ resources/
+ chat.composite - the SCA assembly for this sample
+ webapp
+ chat.html - the html UserInterface for this application
+ META-INF/
+ sca-contribution.xml - specifies the composite to be deployed
+ WEB-INF/
+ web.xml - defines the listener that starts up the
+ Tuscany SCA runtime
+
+ pom.xml - the Maven build file
+
+Building And Running The Sample Using Maven
+-------------------------------------------
+With either the binary or source distributions the sample can be built and run
+using Maven as follows.
+
+cd chat-webapp
+mvn
+
+Again this should result in a war file (sample-chat-webapp.war) in the target
+directory. Follow the steps described in the previous section for running the web
+app and for the expected results.
+
+
diff --git a/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/build.xml b/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/build.xml
new file mode 100644
index 0000000000..804f5a6e79
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/build.xml
@@ -0,0 +1,175 @@
+<!--
+ * 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.
+-->
+<project name="sample-chat-webapp" default="package">
+ <property file="${user.home}/tuscany/build.properties" />
+ <property file="${user.home}/build.properties" />
+
+ <property name="tuscany.sca.manifest.location" value="../../lib/tuscany-sca-manifest.jar"/>
+ <property name="tuscany.sca.lib.location" value="../../lib"/>
+ <property name="tuscany.sca.modules.location" value="../../modules"/>
+
+ <path id="project.classpath">
+ <pathelement path="target/classes"/>
+ <pathelement path="target/sdo-source"/>
+ <pathelement location="${tuscany.sca.manifest.location}"/>
+ </path>
+
+ <target name="init">
+ <mkdir dir="target/classes"/>
+ <mkdir dir="target/sdo-source"/>
+ </target>
+
+
+ <target name="compile" depends="init">
+ <javac destdir="target/classes"
+ debug="on"
+ source="1.5"
+ target="1.5">
+ <src location="src/main/java"/>
+ <src location="target/sdo-source"/>
+ <classpath refid="project.classpath"/>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ <fileset dir="target/sdo-source"/>
+ </copy>
+ </target>
+
+ <target name="package" depends="compile">
+ <war destfile="target/sample-chat-webapp.war"
+ webxml="src/main/webapp/WEB-INF/web.xml">
+ <fileset dir="src/main/webapp"/>
+ <zipfileset dir="../../modules" prefix="WEB-INF/lib">
+ <include name="tuscany-assembly-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-assembly-xml-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-assembly-xsd-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-binding-dwr-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-binding-feed-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-binding-jsonrpc-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-binding-sca-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-binding-sca-xml-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-binding-ws-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-binding-ws-axis2-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-binding-ws-xml-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-contribution-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-contribution-impl-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-contribution-java-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-contribution-namespace-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-core-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-core-databinding-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-core-spi-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-databinding-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-databinding-axiom-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-databinding-jaxb-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-databinding-sdo-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-definitions-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-domain-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-domain-api-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-extension-helper-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-host-embedded-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-host-http-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-host-webapp-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-implementation-java-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-implementation-java-runtime-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-implementation-java-xml-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-interface-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-interface-java-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-interface-java-xml-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-interface-wsdl-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-interface-wsdl-xml-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-node-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-policy-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-policy-security-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-policy-xml-1.0-incubating-SNAPSHOT.jar"/>
+ <include name="tuscany-sca-api-1.0-incubating-SNAPSHOT.jar"/>
+ </zipfileset>
+ <lib dir="../../lib">
+ <include name="activation-1.1.jar"/>
+ <include name="annogen-0.1.0.jar"/>
+ <include name="ant-1.7.0.jar"/>
+ <include name="ant-launcher-1.7.0.jar"/>
+ <include name="axiom-api-1.2.5.jar"/>
+ <include name="axiom-dom-1.2.5.jar"/>
+ <include name="axiom-impl-1.2.5.jar"/>
+ <include name="axis2-adb-1.3.jar"/>
+ <include name="axis2-codegen-1.3.jar"/>
+ <include name="axis2-java2wsdl-1.3.jar"/>
+ <include name="axis2-kernel-1.3.jar"/>
+ <include name="axis2-mtompolicy-1.3.jar"/>
+ <include name="backport-util-concurrent-2.2.jar"/>
+ <include name="cglib-nodep-2.1_3.jar"/>
+ <include name="common-2.2.3.jar"/>
+ <include name="commons-codec-1.3.jar"/>
+ <include name="commons-fileupload-1.1.1.jar"/>
+ <include name="commons-httpclient-3.0.1.jar"/>
+ <include name="commons-io-1.2.jar"/>
+ <include name="commons-logging-1.1.jar"/>
+ <include name="dwr-2.0.1.jar"/>
+ <include name="ecore-2.2.3.jar"/>
+ <include name="ecore-change-2.2.3.jar"/>
+ <include name="ecore-xmi-2.2.3.jar"/>
+ <include name="geronimo-activation_1.1_spec-1.0-M1.jar"/>
+ <include name="geronimo-commonj_1.1_spec-1.0.jar"/>
+ <include name="geronimo-javamail_1.4_spec-1.0-M1.jar"/>
+ <include name="geronimo-jms_1.1_spec-1.1.jar"/>
+ <include name="httpcore-4.0-alpha5.jar"/>
+ <include name="httpcore-nio-4.0-alpha5.jar"/>
+ <include name="httpcore-niossl-4.0-alpha5.jar"/>
+ <include name="jaxb-api-2.1.jar"/>
+ <include name="jaxb-impl-2.1.4.jar"/>
+ <include name="jaxen-1.1.1.jar"/>
+ <include name="jaxws-api-2.1.jar"/>
+ <include name="jdom-1.0.jar"/>
+ <include name="json-rpc-1.0.jar"/>
+ <include name="jsr181-api-1.0-MR1.jar"/>
+ <include name="jsr250-api-1.0.jar"/>
+ <include name="mail-1.4.jar"/>
+ <include name="neethi-2.0.2.jar"/>
+ <include name="rampart-core-1.3.jar"/>
+ <include name="rampart-policy-1.3.jar"/>
+ <include name="rampart-trust-1.3.jar"/>
+ <include name="rome-0.9.jar"/>
+ <include name="saaj-api-1.3.jar"/>
+ <include name="stax-api-1.0-2.jar"/>
+ <include name="stax-api-1.0.1.jar"/>
+ <include name="woden-1.0-incubating-M7b.jar"/>
+ <include name="wsdl4j-1.6.2.jar"/>
+ <include name="wss4j-1.5.3.jar"/>
+ <include name="wstx-asl-3.2.1.jar"/>
+ <include name="xalan-2.7.0.jar"/>
+ <include name="xercesImpl-2.8.1.jar"/>
+ <include name="xml-apis-1.3.03.jar"/>
+ <include name="XmlSchema-1.3.2.jar"/>
+ <include name="xmlsec-1.4.0.jar"/>
+ <include name="xsd-2.2.3.jar"/>
+ <include name="tuscany-sdo-api-r2.1-1.0-incubating.jar"/>
+ <include name="tuscany-sdo-impl-1.0-incubating.jar"/>
+ <include name="tuscany-sdo-lib-1.0-incubating.jar"/>
+ </lib>
+ <classes dir="target/classes"/>
+ <classes dir="target/sdo-source"/>
+ </war>
+ </target>
+
+ <target name="clean">
+ <delete quiet="true" includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/pom.xml b/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/pom.xml
new file mode 100644
index 0000000000..a400b9c413
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-chat-webapp</artifactId>
+ <packaging>war</packaging>
+ <name>Apache Tuscany SCA Chat Sample WebApp</name>
+
+ <repositories>
+ <repository>
+ <id>apache.incubator</id>
+ <url>http://people.apache.org/repo/m2-incubating-repository</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-webapp</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-dwr</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+
+</project>
diff --git a/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/java/sample/ChatService.java b/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/java/sample/ChatService.java
new file mode 100644
index 0000000000..ca90b8f579
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/java/sample/ChatService.java
@@ -0,0 +1,26 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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.
+ */
+package sample;
+
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface ChatService {
+
+ public void chat(String msg);
+
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/java/sample/ChatServiceImpl.java b/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/java/sample/ChatServiceImpl.java
new file mode 100644
index 0000000000..7d0bfb3307
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/java/sample/ChatServiceImpl.java
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+package sample;
+
+import org.osoa.sca.annotations.Scope;
+
+@Scope("COMPOSITE")
+public class ChatServiceImpl implements ChatService {
+
+ ChatService chatters;
+
+ public void chat(String msg) {
+ chatters.chat(msg);
+ }
+
+ public void setChatters(ChatService chatters) {
+ this.chatters = chatters;
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/resources/chat.composite b/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/resources/chat.composite
new file mode 100644
index 0000000000..c9ce95e2dc
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/resources/chat.composite
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="Chat">
+
+ <service name="ChatService" promote="ChatComponent">
+ <interface.java interface="sample.ChatService"/>
+ <tuscany:binding.dwr/>
+ </service>
+
+ <component name="ChatComponent">
+ <implementation.java class="sample.ChatServiceImpl"/>
+ </component>
+
+ <reference name="ChatReference" promote="ChatComponent/chatters">
+ <interface.java interface="sample.ChatService" />
+ <tuscany:binding.dwr/>
+ </reference>
+
+</composite>
diff --git a/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/webapp/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/webapp/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..897849ff8d
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/webapp/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:Chat"/>
+</contribution> \ No newline at end of file
diff --git a/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/webapp/WEB-INF/web.xml b/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000000..97d91fec56
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+ Licensed 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.
+ -->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
+Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <display-name>Apache Tuscany AJAX/DWR Chat Sample</display-name>
+
+ <filter>
+ <filter-name>tuscany</filter-name>
+ <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>tuscany</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <welcome-file-list>
+ <welcome-file>chat.html</welcome-file>
+ </welcome-file-list>
+
+</web-app>
diff --git a/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/webapp/chat.html b/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/webapp/chat.html
new file mode 100644
index 0000000000..7a449a906a
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0/samples/chat-webapp/src/main/webapp/chat.html
@@ -0,0 +1,70 @@
+<!--
+ * 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.
+-->
+<html>
+ <head>
+ <title>Apache Tuscany Ajax/DWR Chat Sample</TITLE>
+
+ <script type="text/javascript" src="SCADomain/scaDomain.js"></script>
+
+ <script language="JavaScript">
+
+ function clickButton(e, buttonid){
+ var evt = e ? e : window.event;
+ var bt = document.getElementById(buttonid);
+ if (bt){
+ if (evt.keyCode == 13){
+ bt.click();
+ return false;
+ }
+ }
+ }
+
+ ChatReference.chat = function(msg) {
+ var chatLog = document.getElementById('chatLog');
+ chatLog.innerHTML = msg + '<br>' + chatLog.innerHTML;
+ }
+
+ function sendChat() {
+ var chatText = document.getElementById("chatText");
+ var nickName = document.getElementById("nickName").value;
+ var msg = nickName + ": " + chatText.value
+ chatText.value = "";
+ chatText.focus();
+ ChatService.chat(msg);
+ }
+ </script>
+
+ </head>
+ <body onLoad="scaDomain.open()">
+
+ <h2>Apache Tuscany Ajax/DWR Chat Sample</h2>
+
+ A simple client to chat between multiple web browsers:<br><br>
+
+ Nickname: <input type="text" id="nickName" size="10"/>
+ <br><br>
+
+ Enter text: <input type="text" id="chatText" size="80" onkeypress="return clickButton(event,'Send')"/>
+ <input type="button" name="Send" value="Send" id="Send" onclick="sendChat()" />
+
+ <br><br>
+ <div id="chatLog" style="overflow:auto; height:400px; border:1px solid"></div>
+
+ </body>
+</html>