Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A tuscany provided servlet filter (org.apache.tuscany.sca.host.webapp.TuscanyServletFilter) is configured to startup/shutdown the Tuscany runtime when the web application is started or stopped. The tuscany filter is also responsible to dispatch HTTP requests to HTTP-based bindings such as Web Services, JSONRPC and Atom/RSS Feed. Figure 1 below shows how the tuscany servlet filter bridges web application to SCA.

Center

As illustrated in Figure 2, there are a few important files or folders in the WAR:

Image Removed

  • !tuscany-war.jpg|align=center!
    Center

    Anchor
    web.xml
    web.xml

2.1 web.xml

Code Block
2xml
titleSample WEB-INF/web.xml
borderStylesolid
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>

  <display-name>Apache Tuscany Calculator Web Service Sample</display-name>
    <filter>
        <filter-name>tuscany</filter-name>
        <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>tuscany</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

</web-app>

...

Code Block
2xml
titleMETA-INF/calculator.composite
borderStylesolid
<?xml version="1.0" encoding="UTF-8"?>
<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
              targetNamespace="http://sample"
              xmlns:sample="http://sample">
   <deployable composite="sample:Calculator"/>
</contribution>

 
The  Calculator.composite is one such deployable sca composite and is defined as follows.

Anchor
Calculator.composite
Calculator.composite

...

In Eclipse, following the menu: File - -> Import - -> General --> Exising Projects into Workspace.

4. Configure the maven pom.xml to generate web.xml and geronimo-web.xml automatically

...