You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2010/12/03 09:01:38 UTC
svn commit: r1041721 - in
/tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main:
java/ java/sample/ java/sample/Helloworld.java webapp/WEB-INF/
webapp/WEB-INF/web.composite webapp/WEB-INF/web.xml webapp/hello.html
webapp/hello.jsp
Author: antelder
Date: Fri Dec 3 08:01:37 2010
New Revision: 1041721
URL: http://svn.apache.org/viewvc?rev=1041721&view=rev
Log:
Clean up the getting started helloworld webapp. Update it to use a jsp to invoke the component
Added:
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/java/
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/java/sample/
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/java/sample/Helloworld.java (with props)
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/webapp/WEB-INF/web.composite
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/webapp/hello.jsp
Removed:
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/webapp/hello.html
Modified:
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/webapp/WEB-INF/ (props changed)
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/webapp/WEB-INF/web.xml
Added: tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/java/sample/Helloworld.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/java/sample/Helloworld.java?rev=1041721&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/java/sample/Helloworld.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/java/sample/Helloworld.java Fri Dec 3 08:01:37 2010
@@ -0,0 +1,28 @@
+/*
+ * 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.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface Helloworld {
+
+ String sayHello(String name);
+
+}
Propchange: tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/java/sample/Helloworld.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/java/sample/Helloworld.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/webapp/WEB-INF/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Dec 3 08:01:37 2010
@@ -0,0 +1 @@
+sca-contributions
Added: tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/webapp/WEB-INF/web.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/webapp/WEB-INF/web.composite?rev=1041721&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/webapp/WEB-INF/web.composite (added)
+++ tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/webapp/WEB-INF/web.composite Fri Dec 3 08:01:37 2010
@@ -0,0 +1,30 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://samples"
+ name="Helloworld">
+
+ <component name="foo">
+ <implementation.web web-uri=""/>
+ <reference name="service" target="HelloworldComponent"/>
+ </component>
+
+</composite>
Modified: tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/webapp/WEB-INF/web.xml?rev=1041721&r1=1041720&r2=1041721&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/webapp/WEB-INF/web.xml (original)
+++ tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/webapp/WEB-INF/web.xml Fri Dec 3 08:01:37 2010
@@ -24,18 +24,6 @@
<display-name>Apache Tuscany Helloworld Sample</display-name>
- <context-param>
- <param-name>contributions</param-name>
- <param-value>/WEB-INF/sca-contributions</param-value>
- </context-param>
-
-<!-- TODO: need to sort out what to do about distributed domain
- <context-param>
- <param-name>org.apache.tuscany.sca.config</param-name>
- <param-value>uri:default</param-value>
- </context-param>
--->
-
<filter>
<filter-name>tuscany</filter-name>
<filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
@@ -46,4 +34,8 @@
<url-pattern>/*</url-pattern>
</filter-mapping>
+ <welcome-file-list id="WelcomeFileList">
+ <welcome-file>hello.jsp</welcome-file>
+ </welcome-file-list>
+
</web-app>
Added: tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/webapp/hello.jsp
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/webapp/hello.jsp?rev=1041721&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/webapp/hello.jsp (added)
+++ tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/src/main/webapp/hello.jsp Fri Dec 3 08:01:37 2010
@@ -0,0 +1,37 @@
+<!--
+ * 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="service" type="sample.Helloworld" />
+
+<html>
+ <body >
+
+ <h2>Apache Tuscany Helloworld JSP Sample</h2>
+
+ Calling HelloworldService sayHello("world") returns:
+
+ <p>
+
+ <%= service.sayHello("world") %>
+
+ </body>
+</html>