You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2008/03/18 03:36:59 UTC

svn commit: r638184 - in /incubator/tuscany/java/sca/tutorial/nodes-jee/catalog-webapp: pom.xml webapp/WEB-INF/web.xml webapp/catalog.jsp

Author: jsdelfino
Date: Mon Mar 17 19:36:52 2008
New Revision: 638184

URL: http://svn.apache.org/viewvc?rev=638184&view=rev
Log:
Fixed tuscany servlet filter name. Added code to the sample JSP to display the contents of the catalog.

Modified:
    incubator/tuscany/java/sca/tutorial/nodes-jee/catalog-webapp/pom.xml
    incubator/tuscany/java/sca/tutorial/nodes-jee/catalog-webapp/webapp/WEB-INF/web.xml
    incubator/tuscany/java/sca/tutorial/nodes-jee/catalog-webapp/webapp/catalog.jsp

Modified: incubator/tuscany/java/sca/tutorial/nodes-jee/catalog-webapp/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/nodes-jee/catalog-webapp/pom.xml?rev=638184&r1=638183&r2=638184&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/nodes-jee/catalog-webapp/pom.xml (original)
+++ incubator/tuscany/java/sca/tutorial/nodes-jee/catalog-webapp/pom.xml Mon Mar 17 19:36:52 2008
@@ -46,7 +46,21 @@
 
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-node2-launcher-webapp</artifactId>
+            <artifactId>tuscany-node2-api</artifactId>
+            <version>1.2-incubating-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tutorial-assets</artifactId>
+            <version>1.2-incubating-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node2-launcher</artifactId>
             <version>1.2-incubating-SNAPSHOT</version>
             <scope>runtime</scope>
         </dependency>

Modified: incubator/tuscany/java/sca/tutorial/nodes-jee/catalog-webapp/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/nodes-jee/catalog-webapp/webapp/WEB-INF/web.xml?rev=638184&r1=638183&r2=638184&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/nodes-jee/catalog-webapp/webapp/WEB-INF/web.xml (original)
+++ incubator/tuscany/java/sca/tutorial/nodes-jee/catalog-webapp/webapp/WEB-INF/web.xml Mon Mar 17 19:36:52 2008
@@ -22,11 +22,11 @@
 Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
 <web-app>
 
-  <display-name>Fruit Catalog Web App</display-name>
+  <display-name>Fruit Catalog</display-name>
   
   <filter>
     <filter-name>tuscany</filter-name> 
-    <filter-class>org.apache.tuscany.sca.node.launcher.webapp.NodeServletFilter</filter-class> 
+    <filter-class>org.apache.tuscany.sca.node.launcher.NodeServletFilter</filter-class> 
   </filter>
 
   <filter-mapping>

Modified: incubator/tuscany/java/sca/tutorial/nodes-jee/catalog-webapp/webapp/catalog.jsp
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/nodes-jee/catalog-webapp/webapp/catalog.jsp?rev=638184&r1=638183&r2=638184&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/nodes-jee/catalog-webapp/webapp/catalog.jsp (original)
+++ incubator/tuscany/java/sca/tutorial/nodes-jee/catalog-webapp/webapp/catalog.jsp Mon Mar 17 19:36:52 2008
@@ -17,15 +17,36 @@
  * under the License.
 --%>
 
+<%@ page import="org.apache.tuscany.sca.node.SCAClient"%>
+<%@ page import="services.Catalog" %>
+<%@page import="services.Item"%>
+
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+<%
+  
+  SCAClient client = (SCAClient) application.getAttribute("org.apache.tuscany.sca.node.SCAClient");
+   
+  Catalog catalog = (Catalog)client.getService(Catalog.class, "WebFruitsCatalog");
+  Item[] items = catalog.get();
+  
+%>
 
 <html>
 <head><title>Catalog</title></head>
 
 <body>
-<table>
-    <tr>
-        <th>Item</th>
-    </tr>  
+<h1>Catalog</h1>
+
+<table border="0">
+
+<% for (Item item: items) { %>>
+
+    <tr><td><%=item.getName() %></td><td><%=item.getPrice() %></td></tr>
+
+<% } %>
+
 </table>
+
 </body>
 </html>



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org