From e1539a531da3192dac843520d77c8c76e407a402 Mon Sep 17 00:00:00 2001 From: lresende Date: Sat, 21 Nov 2009 07:55:07 +0000 Subject: Moving 1.x tags git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@882849 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/samples/sca/helloworldweb/readme.htm | 248 +++++++++++++++++++++ 1 file changed, 248 insertions(+) create mode 100644 sca-java-1.x/tags/java-M1-20060522/java/samples/sca/helloworldweb/readme.htm (limited to 'sca-java-1.x/tags/java-M1-20060522/java/samples/sca/helloworldweb/readme.htm') diff --git a/sca-java-1.x/tags/java-M1-20060522/java/samples/sca/helloworldweb/readme.htm b/sca-java-1.x/tags/java-M1-20060522/java/samples/sca/helloworldweb/readme.htm new file mode 100644 index 0000000000..037b1d70f8 --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060522/java/samples/sca/helloworldweb/readme.htm @@ -0,0 +1,248 @@ + + + + + + + + + + + + + + + + + + + + + + + + Tuscany Hello World Web Sample + + + + + + + +

Tuscany Hello World Web Sample

+ + + +

Overview

+ + + +

The Tuscany hello world web sample shows using the Tuscany SCA + runtime in a Tomcat environment being accessed from a JSP + page that + implements the classic introductory hello world example.

+

Location

+This sample is located  in the samples\sca\helloworldweb directory. + + + +

Setup

+ +Set up your server as described in the Tomcat Setup.   + +If you are not using the pre-configured Tomcat server from the binary distribution, you will need to add sample-helloworldweb-incubating-M1.war to your tomcat's webapp directory.
+ + + +

Running

+ + + +Once you've started your web server, use your browse to view the +following URL: http://localhost:8080/sample-helloworldweb/ +
+ + + +You should see a form you can supply your name and a submit button. + Once you submit the form the JSP page calls a Java class that +gets the CurrentModuleContext and locates the SCA component to execute +the greeting service.  Note, unlike the a J2SE in a Tomcat environment the Tuscany runtime is automatically +initialized and running. +

Results

+ + + +

The page should be updated with the greeting displayed below + the form.
+ + + +

+ + + +

Code Overview

+ + + +The source files are physically organized as shown below:
+ + + + + + + + + + + + + + + + + + + + +
+ + +
src
+---main
+---java
¦ +---helloworld
¦ HelloWorldImpl.java
¦ HelloWorldService.java
¦
+---resources
¦ sca.module
¦
+---webapp
¦ HelloWorldWeb.jsp
¦
¦
+---WEB-INF
web.xml

+ + +
+ + +
+ + +
+ + + +

 

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
sca.moduleDefines the SCA module and component. Defines for the + HelloWorldServiceComponent component and the Java class that + implements that component
HelloWorldService.javaDefines the Java interface implemented by the component.
HelloWorldImpl.javaImplements the SCA component. Uses the SCA service + annotation tag on the class to show what SCA interface is being + implemented.
HelloWorldWeb.jspHandles Web form input.. Obtains the module context which was defined by the + sca.module file. From the module context locates the + HelloWorldServiceComponent and then calls  the getGreetings + method to invoke the component. and formats  returned results.
web.xmlStandard J2EE web application's web.xml
+ + + +
+ + + + -- cgit v1.2.3