geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r832687 - in /geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet: pom.xml src/main/java/sample/HelloworldServlet.java src/main/webapp/WEB-INF/web.composite src/main/webapp/WEB-INF/web.xml
Date Wed, 04 Nov 2009 09:26:37 GMT
Author: vamsic007
Date: Wed Nov  4 09:26:34 2009
New Revision: 832687

URL: http://svn.apache.org/viewvc?rev=832687&view=rev
Log:
Update the sample to demonstrate reconfiguring of env entry through SCA property.

Modified:
    geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/pom.xml
    geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/java/sample/HelloworldServlet.java
    geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/web.composite
    geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/web.xml

Modified: geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/pom.xml?rev=832687&r1=832686&r2=832687&view=diff
==============================================================================
--- geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/pom.xml (original)
+++ geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/pom.xml Wed Nov  4 09:26:34
2009
@@ -41,6 +41,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-annotation_1.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-servlet_2.5_spec</artifactId>
             <scope>provided</scope>
         </dependency>

Modified: geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/java/sample/HelloworldServlet.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/java/sample/HelloworldServlet.java?rev=832687&r1=832686&r2=832687&view=diff
==============================================================================
--- geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/java/sample/HelloworldServlet.java
(original)
+++ geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/java/sample/HelloworldServlet.java
Wed Nov  4 09:26:34 2009
@@ -21,11 +21,13 @@
 import java.io.IOException;
 import java.io.Writer;
 
+import javax.annotation.Resource;
 import javax.ejb.EJB;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.osoa.sca.annotations.Property;
 import org.osoa.sca.annotations.Reference;
 
 import sample.ejb3.HelloworldService;
@@ -45,6 +47,21 @@
     @EJB
     protected HelloworldService ejbService;
 
+    @Property
+    protected String scaProperty;
+    
+    @Resource(name="envEntry1")
+    protected String envEntry1;
+
+    @Resource(name="envEntry2")
+    protected String envEntry2;
+
+    @Resource(name="a/b/envEntry3")
+    protected String envEntry3;
+            
+    @Resource(name="a/b/envEntry4")
+    protected java.lang.Integer envEntry4;
+            
     @Override
     protected void service(HttpServletRequest request, HttpServletResponse response) throws
IOException {
         String name = request.getParameter("name");
@@ -62,6 +79,17 @@
         out.write("<br>"+greeting2);
         out.write("<br><br>EJB rewired using SCA :: HelloworldService.getGreeting:
"+name);
         out.write("<br>"+greeting3);
+        out.write("<hr>");
+        out.write("<br>SCA Property");
+        out.write("<br>"+scaProperty);
+        out.write("<br><br>Env Entry1");
+        out.write("<br>"+envEntry1);
+        out.write("<br><br>Env Entry2");
+        out.write("<br>"+envEntry2);
+        out.write("<br><br>Env Entry3");
+        out.write("<br>"+envEntry3);
+        out.write("<br><br>Env Entry4");
+        out.write("<br>"+envEntry4);
         out.write("</body></html>");
         out.flush();
         out.close();

Modified: geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/web.composite
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/web.composite?rev=832687&r1=832686&r2=832687&view=diff
==============================================================================
--- geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/web.composite
(original)
+++ geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/web.composite
Wed Nov  4 09:26:34 2009
@@ -25,6 +25,9 @@
         <implementation.web web-uri="helloworld-simple-servlet.war"/>
         <reference name="sample.HelloworldServlet_scaService" target="HelloworldServiceComponent"/>
         <reference name="sample.HelloworldServlet_ejbService" target="HelloworldServiceComponent"/>
+        <property name="sample.HelloworldServlet_scaProperty">property1</property>
+        <property name="envEntry2">value configured through SCA property</property>
+        <property name="a_b_envEntry3">value configured through SCA property</property>
     </component>
 </composite>
 

Modified: geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/web.xml?rev=832687&r1=832686&r2=832687&view=diff
==============================================================================
--- geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/web.xml
(original)
+++ geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/web.xml
Wed Nov  4 09:26:34 2009
@@ -37,5 +37,25 @@
   <welcome-file-list id="WelcomeFileList">
     <welcome-file>hello.html</welcome-file>
   </welcome-file-list>
-
+  
+  <env-entry>
+    <env-entry-name>envEntry1</env-entry-name>
+    <env-entry-value>env entry1 value configured in web.xml</env-entry-value>
+    <env-entry-type>java.lang.String</env-entry-type>
+  </env-entry>
+  <env-entry>
+    <env-entry-name>envEntry2</env-entry-name>
+    <env-entry-value>env entry2 value configured in web.xml</env-entry-value>
+    <env-entry-type>java.lang.String</env-entry-type>
+  </env-entry>
+  <env-entry>
+    <env-entry-name>a/b/envEntry3</env-entry-name>
+    <env-entry-value>env entry3 value configured in web.xml</env-entry-value>
+    <env-entry-type>java.lang.String</env-entry-type>
+  </env-entry>
+  <env-entry>
+    <env-entry-name>a/b/envEntry4</env-entry-name>
+    <env-entry-value>12345</env-entry-value>
+    <env-entry-type>java.lang.Integer</env-entry-type>
+  </env-entry>
 </web-app>



Mime
View raw message