diff options
Diffstat (limited to '')
3 files changed, 113 insertions, 0 deletions
diff --git a/sandbox/old/contrib/old-samples/webapp/webcalc/src/main/webapp/WEB-INF/default.scdl b/sandbox/old/contrib/old-samples/webapp/webcalc/src/main/webapp/WEB-INF/default.scdl new file mode 100644 index 0000000000..d159fd7a38 --- /dev/null +++ b/sandbox/old/contrib/old-samples/webapp/webcalc/src/main/webapp/WEB-INF/default.scdl @@ -0,0 +1,33 @@ +<?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/2.0-alpha" + name="CalculatorComposite"> + + <!-- config that includes the calculator composite --> + <include name="CalculatorComposite" scdlResource="META-INF/sca/default.scdl"/> + + <component name="webcalc"> + <tuscany:webapp> + <reference name="calculatorService" interface="calculator.CalculatorService"/> + </tuscany:webapp> + <reference name="calculatorService" target="CalculatorServiceComponent"/> + </component> +</composite> diff --git a/sandbox/old/contrib/old-samples/webapp/webcalc/src/main/webapp/WEB-INF/web.xml b/sandbox/old/contrib/old-samples/webapp/webcalc/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..2232ddc3ef --- /dev/null +++ b/sandbox/old/contrib/old-samples/webapp/webcalc/src/main/webapp/WEB-INF/web.xml @@ -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. +--> + +<web-app version="2.4" + xmlns="http://java.sun.com/xml/ns/j2ee" + 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> + + <welcome-file-list id="WelcomeFileList"> + <welcome-file>calc.jsp</welcome-file> + </welcome-file-list> + + <listener> + <listener-class>org.apache.tuscany.runtime.webapp.TuscanyContextListener</listener-class> + </listener> + + <context-param> + <param-name>tuscany.component</param-name> + <param-value>webcalc</param-value> + </context-param> +</web-app> diff --git a/sandbox/old/contrib/old-samples/webapp/webcalc/src/main/webapp/calc.jsp b/sandbox/old/contrib/old-samples/webapp/webcalc/src/main/webapp/calc.jsp new file mode 100644 index 0000000000..f561f82ea4 --- /dev/null +++ b/sandbox/old/contrib/old-samples/webapp/webcalc/src/main/webapp/calc.jsp @@ -0,0 +1,40 @@ +<%@ page import="calculator.CalculatorService" %> +<%-- + * 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" %> +<% + CalculatorService calc = (CalculatorService) application.getAttribute("calculatorService"); +%> +<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 |