From c5bbbaa969f990c7ebcebefd11ee3fad0f6c7636 Mon Sep 17 00:00:00 2001 From: rfeng Date: Fri, 18 Sep 2009 17:40:39 +0000 Subject: Add the helloworld-jsp app that can be run on Google App Engine git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@816722 13f79535-47bb-0310-9956-ffa450edef68 --- .../helloworld-jsp-google-appengine/.classpath | 10 ++ .../rfeng/helloworld-jsp-google-appengine/.project | 34 +++++++ .../com.google.appengine.eclipse.core.prefs | 3 + .../.settings/com.google.gdt.eclipse.core.prefs | 3 + .../rfeng/helloworld-jsp-google-appengine/pom.xml | 107 +++++++++++++++++++++ .../src/META-INF/jdoconfig.xml | 15 +++ .../src/log4j.properties | 24 +++++ .../src/sample/HelloworldService.java | 25 +++++ .../src/sample/HelloworldServiceImpl.java | 38 ++++++++ .../src/sample/appengine/HelloWorldServlet.java | 51 ++++++++++ .../war/WEB-INF/appengine-web.xml | 11 +++ .../WEB-INF/lib/appengine-api-1.0-sdk-1.2.5.jar | Bin 0 -> 8776503 bytes .../war/WEB-INF/lib/appengine-api-labs-1.2.5.jar | Bin 0 -> 338903 bytes .../WEB-INF/lib/datanucleus-appengine-1.0.3.jar | Bin 0 -> 245333 bytes .../war/WEB-INF/lib/datanucleus-core-1.1.5.jar | Bin 0 -> 1933065 bytes .../war/WEB-INF/lib/datanucleus-jpa-1.1.5.jar | Bin 0 -> 152768 bytes .../WEB-INF/lib/geronimo-jpa_3.0_spec-1.1.1.jar | Bin 0 -> 52877 bytes .../WEB-INF/lib/geronimo-jta_1.1_spec-1.1.1.jar | Bin 0 -> 16030 bytes .../war/WEB-INF/lib/jdo2-api-2.3-eb.jar | Bin 0 -> 192820 bytes .../war/WEB-INF/logging.properties | 28 ++++++ .../war/WEB-INF/web.composite | 34 +++++++ .../war/WEB-INF/web.xml | 26 +++++ .../helloworld-jsp-google-appengine/war/error.jsp | 35 +++++++ .../helloworld-jsp-google-appengine/war/hello.jsp | 57 +++++++++++ .../helloworld-jsp-google-appengine/war/index.html | 36 +++++++ 25 files changed, 537 insertions(+) create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/.classpath create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/.project create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/.settings/com.google.appengine.eclipse.core.prefs create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/.settings/com.google.gdt.eclipse.core.prefs create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/pom.xml create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/src/META-INF/jdoconfig.xml create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/src/log4j.properties create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/src/sample/HelloworldService.java create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/src/sample/HelloworldServiceImpl.java create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/src/sample/appengine/HelloWorldServlet.java create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/appengine-web.xml create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/appengine-api-1.0-sdk-1.2.5.jar create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/appengine-api-labs-1.2.5.jar create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/datanucleus-appengine-1.0.3.jar create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/datanucleus-core-1.1.5.jar create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/datanucleus-jpa-1.1.5.jar create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/geronimo-jpa_3.0_spec-1.1.1.jar create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/geronimo-jta_1.1_spec-1.1.1.jar create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/jdo2-api-2.3-eb.jar create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/logging.properties create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/web.composite create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/web.xml create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/war/error.jsp create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/war/hello.jsp create mode 100644 sandbox/rfeng/helloworld-jsp-google-appengine/war/index.html (limited to 'sandbox/rfeng') diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/.classpath b/sandbox/rfeng/helloworld-jsp-google-appengine/.classpath new file mode 100644 index 0000000000..53ef297886 --- /dev/null +++ b/sandbox/rfeng/helloworld-jsp-google-appengine/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/.project b/sandbox/rfeng/helloworld-jsp-google-appengine/.project new file mode 100644 index 0000000000..bf5805d66d --- /dev/null +++ b/sandbox/rfeng/helloworld-jsp-google-appengine/.project @@ -0,0 +1,34 @@ + + + sample-helloworld-jsp-google-appengine + + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.google.appengine.eclipse.core.enhancerbuilder + + + + + com.google.appengine.eclipse.core.projectValidator + + + + + com.google.gdt.eclipse.core.webAppProjectValidator + + + + + + org.eclipse.jdt.core.javanature + com.google.appengine.eclipse.core.gaeNature + com.google.gdt.eclipse.core.webAppNature + + diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/.settings/com.google.appengine.eclipse.core.prefs b/sandbox/rfeng/helloworld-jsp-google-appengine/.settings/com.google.appengine.eclipse.core.prefs new file mode 100644 index 0000000000..a81881e604 --- /dev/null +++ b/sandbox/rfeng/helloworld-jsp-google-appengine/.settings/com.google.appengine.eclipse.core.prefs @@ -0,0 +1,3 @@ +#Thu Sep 17 15:10:38 PDT 2009 +eclipse.preferences.version=1 +filesCopiedToWebInfLib=appengine-api-1.0-sdk-1.2.5.jar|appengine-api-labs-1.2.5.jar|datanucleus-appengine-1.0.3.jar|datanucleus-core-1.1.5.jar|datanucleus-jpa-1.1.5.jar|geronimo-jpa_3.0_spec-1.1.1.jar|geronimo-jta_1.1_spec-1.1.1.jar|jdo2-api-2.3-eb.jar diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/.settings/com.google.gdt.eclipse.core.prefs b/sandbox/rfeng/helloworld-jsp-google-appengine/.settings/com.google.gdt.eclipse.core.prefs new file mode 100644 index 0000000000..ff2819c70a --- /dev/null +++ b/sandbox/rfeng/helloworld-jsp-google-appengine/.settings/com.google.gdt.eclipse.core.prefs @@ -0,0 +1,3 @@ +#Thu Sep 17 15:54:49 PDT 2009 +eclipse.preferences.version=1 +jarsExcludedFromWebInfLib= diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/pom.xml b/sandbox/rfeng/helloworld-jsp-google-appengine/pom.xml new file mode 100644 index 0000000000..3107e3717a --- /dev/null +++ b/sandbox/rfeng/helloworld-jsp-google-appengine/pom.xml @@ -0,0 +1,107 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 2.0-SNAPSHOT + + + sample-helloworld-jsp-google-appengine + war + Apache Tuscany SCA Sample Helloworld JSP on Google App Engine + + + + + org.apache.tuscany.sca + tuscany-sca-api + 2.0-SNAPSHOT + compile + + + + org.apache.tuscany.sca + tuscany-implementation-web-runtime + 2.0-SNAPSHOT + compile + + + + + + ${artifactId} + + + + org.apache.maven.plugins + maven-eclipse-plugin + + + org.eclipse.jdt.core.javanature + com.google.appengine.eclipse.core.gaeNature + com.google.gdt.eclipse.core.webAppNature + + + org.eclipse.jdt.core.javabuilder + com.google.appengine.eclipse.core.enhancerbuilder + com.google.appengine.eclipse.core.projectValidator> + com.google.gdt.eclipse.core.webAppProjectValidator> + + + org.eclipse.jdt.launching.JRE_CONTAINER + com.google.appengine.eclipse.core.GAE_CONTAINER + + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.1 + + + copy-dependencies + process-sources + + copy-dependencies + + + war/WEB-INF/lib + true + + + + + + + org.apache.maven.plugins + maven-war-plugin + 2.1-beta-1 + + war + + + + + + diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/src/META-INF/jdoconfig.xml b/sandbox/rfeng/helloworld-jsp-google-appengine/src/META-INF/jdoconfig.xml new file mode 100644 index 0000000000..5f56aa196e --- /dev/null +++ b/sandbox/rfeng/helloworld-jsp-google-appengine/src/META-INF/jdoconfig.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/src/log4j.properties b/sandbox/rfeng/helloworld-jsp-google-appengine/src/log4j.properties new file mode 100644 index 0000000000..d9c3edc9fe --- /dev/null +++ b/sandbox/rfeng/helloworld-jsp-google-appengine/src/log4j.properties @@ -0,0 +1,24 @@ +# A default log4j configuration for log4j users. +# +# To use this configuration, deploy it into your application's WEB-INF/classes +# directory. You are also encouraged to edit it as you like. + +# Configure the console as our one appender +log4j.appender.A1=org.apache.log4j.ConsoleAppender +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c] - %m%n + +# tighten logging on the DataNucleus Categories +log4j.category.DataNucleus.JDO=WARN, A1 +log4j.category.DataNucleus.Persistence=WARN, A1 +log4j.category.DataNucleus.Cache=WARN, A1 +log4j.category.DataNucleus.MetaData=WARN, A1 +log4j.category.DataNucleus.General=WARN, A1 +log4j.category.DataNucleus.Utility=WARN, A1 +log4j.category.DataNucleus.Transaction=WARN, A1 +log4j.category.DataNucleus.Datastore=WARN, A1 +log4j.category.DataNucleus.ClassLoading=WARN, A1 +log4j.category.DataNucleus.Plugin=WARN, A1 +log4j.category.DataNucleus.ValueGeneration=WARN, A1 +log4j.category.DataNucleus.Enhancer=WARN, A1 +log4j.category.DataNucleus.SchemaTool=WARN, A1 diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/src/sample/HelloworldService.java b/sandbox/rfeng/helloworld-jsp-google-appengine/src/sample/HelloworldService.java new file mode 100644 index 0000000000..53ff7a5ca1 --- /dev/null +++ b/sandbox/rfeng/helloworld-jsp-google-appengine/src/sample/HelloworldService.java @@ -0,0 +1,25 @@ +/* + * 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; + +public interface HelloworldService { + + String sayHello(String name); + +} diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/src/sample/HelloworldServiceImpl.java b/sandbox/rfeng/helloworld-jsp-google-appengine/src/sample/HelloworldServiceImpl.java new file mode 100644 index 0000000000..d69e578698 --- /dev/null +++ b/sandbox/rfeng/helloworld-jsp-google-appengine/src/sample/HelloworldServiceImpl.java @@ -0,0 +1,38 @@ +/* + * 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.EagerInit; +import org.oasisopen.sca.annotation.Init; +import org.oasisopen.sca.annotation.Scope; + +@EagerInit +@Scope("COMPOSITE") +public class HelloworldServiceImpl implements HelloworldService { + + public String sayHello(String name) { + return "Hello " + name; + } + + @Init + public void init() { + System.out.println("Starting..." + sayHello("world")); + } + +} diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/src/sample/appengine/HelloWorldServlet.java b/sandbox/rfeng/helloworld-jsp-google-appengine/src/sample/appengine/HelloWorldServlet.java new file mode 100644 index 0000000000..2750c04c9d --- /dev/null +++ b/sandbox/rfeng/helloworld-jsp-google-appengine/src/sample/appengine/HelloWorldServlet.java @@ -0,0 +1,51 @@ +/* + * 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.appengine; + +import java.io.IOException; +import java.io.PrintWriter; + +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.google.appengine.api.users.User; +import com.google.appengine.api.users.UserService; +import com.google.appengine.api.users.UserServiceFactory; + +@SuppressWarnings("serial") +public class HelloWorldServlet extends HttpServlet { + public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { + resp.setContentType("text/html"); + UserService userService = UserServiceFactory.getUserService(); + User user = userService.getCurrentUser(); + if (user == null) { + resp.sendRedirect(userService.createLoginURL(req.getRequestURI())); + } else { + PrintWriter pw = resp.getWriter(); + pw.println("Test"); + pw.println("

"); + pw.println("Welcome to the SCA Cloud hosted by Google App Engine: " + user); + if (user != null) { + pw.println("User ID: " + user.getUserId() + " E-mail: " + user.getEmail()); + } + pw.println("

"); + } + } +} diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/appengine-web.xml b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/appengine-web.xml new file mode 100644 index 0000000000..ee5bf38725 --- /dev/null +++ b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/appengine-web.xml @@ -0,0 +1,11 @@ + + + scacloud + 2 + + + + + + + \ No newline at end of file diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/appengine-api-1.0-sdk-1.2.5.jar b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/appengine-api-1.0-sdk-1.2.5.jar new file mode 100644 index 0000000000..5e461a1bb5 Binary files /dev/null and b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/appengine-api-1.0-sdk-1.2.5.jar differ diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/appengine-api-labs-1.2.5.jar b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/appengine-api-labs-1.2.5.jar new file mode 100644 index 0000000000..5325404d25 Binary files /dev/null and b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/appengine-api-labs-1.2.5.jar differ diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/datanucleus-appengine-1.0.3.jar b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/datanucleus-appengine-1.0.3.jar new file mode 100644 index 0000000000..fa0773db98 Binary files /dev/null and b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/datanucleus-appengine-1.0.3.jar differ diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/datanucleus-core-1.1.5.jar b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/datanucleus-core-1.1.5.jar new file mode 100644 index 0000000000..c450ab94f3 Binary files /dev/null and b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/datanucleus-core-1.1.5.jar differ diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/datanucleus-jpa-1.1.5.jar b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/datanucleus-jpa-1.1.5.jar new file mode 100644 index 0000000000..c326e0bc08 Binary files /dev/null and b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/datanucleus-jpa-1.1.5.jar differ diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/geronimo-jpa_3.0_spec-1.1.1.jar b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/geronimo-jpa_3.0_spec-1.1.1.jar new file mode 100644 index 0000000000..12d4ab0d28 Binary files /dev/null and b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/geronimo-jpa_3.0_spec-1.1.1.jar differ diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/geronimo-jta_1.1_spec-1.1.1.jar b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/geronimo-jta_1.1_spec-1.1.1.jar new file mode 100644 index 0000000000..ee9963dfc8 Binary files /dev/null and b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/geronimo-jta_1.1_spec-1.1.1.jar differ diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/jdo2-api-2.3-eb.jar b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/jdo2-api-2.3-eb.jar new file mode 100644 index 0000000000..2547a0b03f Binary files /dev/null and b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/lib/jdo2-api-2.3-eb.jar differ diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/logging.properties b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/logging.properties new file mode 100644 index 0000000000..4a78b7f353 --- /dev/null +++ b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/logging.properties @@ -0,0 +1,28 @@ +# A default java.util.logging configuration. +# (All App Engine logging is through java.util.logging by default). +# +# To use this configuration, copy it into your application's WEB-INF +# folder and add the following to your appengine-web.xml: +# +# +# +# +# + +# Set the default logging level for all loggers to WARNING +.level = WARNING + +# Set the default logging level for ORM, specifically, to WARNING +DataNucleus.JDO.level=WARNING +DataNucleus.Persistence.level=WARNING +DataNucleus.Cache.level=WARNING +DataNucleus.MetaData.level=WARNING +DataNucleus.General.level=WARNING +DataNucleus.Utility.level=WARNING +DataNucleus.Transaction.level=WARNING +DataNucleus.Datastore.level=WARNING +DataNucleus.ClassLoading.level=WARNING +DataNucleus.Plugin.level=WARNING +DataNucleus.ValueGeneration.level=WARNING +DataNucleus.Enhancer.level=WARNING +DataNucleus.SchemaTool.level=WARNING diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/web.composite b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/web.composite new file mode 100644 index 0000000000..875d6aae9d --- /dev/null +++ b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/web.composite @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/web.xml b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/web.xml new file mode 100644 index 0000000000..d8dcdf3917 --- /dev/null +++ b/sandbox/rfeng/helloworld-jsp-google-appengine/war/WEB-INF/web.xml @@ -0,0 +1,26 @@ + + + + HelloWorld + sample.appengine.HelloWorldServlet + + + HelloWorld + /helloworld + + + index.html + + + tuscany + org.apache.tuscany.sca.host.webapp.TuscanyServletFilter + + + + tuscany + /* + + diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/war/error.jsp b/sandbox/rfeng/helloworld-jsp-google-appengine/war/error.jsp new file mode 100644 index 0000000000..2a1bb23c91 --- /dev/null +++ b/sandbox/rfeng/helloworld-jsp-google-appengine/war/error.jsp @@ -0,0 +1,35 @@ +<%@ page isErrorPage="true" import="java.io.*"%> + + +Exceptional Even Occurred! + + + + +<%-- Exception Handler --%> + <%=exception.toString()%>
+
+ +<% + out.println(""); +%> + + + diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/war/hello.jsp b/sandbox/rfeng/helloworld-jsp-google-appengine/war/hello.jsp new file mode 100644 index 0000000000..f4d9b937ca --- /dev/null +++ b/sandbox/rfeng/helloworld-jsp-google-appengine/war/hello.jsp @@ -0,0 +1,57 @@ + + +<%@ page contentType="text/html;charset=UTF-8" language="java" + errorPage="error.jsp"%> +<%@ page import="com.google.appengine.api.users.User"%> +<%@ page import="com.google.appengine.api.users.UserService"%> +<%@ page import="com.google.appengine.api.users.UserServiceFactory"%> + +<%@ taglib uri="http://www.osoa.org/sca/sca_jsp.tld" prefix="sca"%> + + + + + + +<% + UserService userService = UserServiceFactory.getUserService(); + User user = userService.getCurrentUser(); + if (user != null) { +%> +

Hello, <%=user.getNickname()%>! (You can sign +out.)

+<% + } else { +%> +

Hello! Sign +in to include your name with greetings you post.

+<% + } +%> + +

Apache Tuscany Helloworld JSP Sample

+ +Calling HelloworldService sayHello("world, "+$user) returns: + +

<%=service.sayHello("world ("+user+")")%> + + diff --git a/sandbox/rfeng/helloworld-jsp-google-appengine/war/index.html b/sandbox/rfeng/helloworld-jsp-google-appengine/war/index.html new file mode 100644 index 0000000000..1df9a9cf2c --- /dev/null +++ b/sandbox/rfeng/helloworld-jsp-google-appengine/war/index.html @@ -0,0 +1,36 @@ + + + + + + + + + + + +SCA Cloud on Google App Engine + + + +

Tuscany SCA on Google App Engine

+ + + + + + + + + + + + + + +
Available Servlets:
First SCA Application - Hello World!
A Simple HelloWorld without SCA
Admin
+

+Brought to you by: Apache Tuscany - http://tuscany.apache.org +

+ + -- cgit v1.2.3