Tapestry/Seam Integration

Provides integration between Tapestry and Seam, allowing Seam components to be injected into and outjected from Tapestry pages and components.

web.xml changes

First, add SeamListener to your web.xml. SeamListener is responsible for initialization and cleanup of a Seam application and session contexts.
<listener>
    <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
</listener>
Secondly, replace your ApplicationServlet by SeamApplicationServlet.
<servlet>
	<servlet-name>app</servlet-name>
	<servlet-class>net.sf.tacos.seam.SeamApplicationServlet</servlet-class>
	<load-on-startup>0</load-on-startup>
</servlet>
If your are going to use Seam Remoting, the Seam Resource servlet must be configured in your web.xml
<servlet>
	<servlet-name>Seam Resource Servlet</servlet-name>
	<servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>Seam Resource Servlet</servlet-name>
    <url-pattern>/seam/resource/*</url-pattern>
</servlet-mapping>
and the Seam.library must be configured in your *.application file.
<library id="seam" specification-path="/net/sf/tacos/Seam.library"/>

Bijection of Seam components

To inject a Seam component you may use the @In annotation.
@In  
public abstract User getUser();
If you want to outject your component back to the context, please use @Out annotation. Since @Out requires non-null value, you can make Seam to create an instance of the component if there is none existing instance by using @In(create=true)
@In(create=true) @Out 
public abstract User getUser();
Furthermore you can inject the value of an expression:
@In("#{user.username}")
public abstract String getUsername();

Expression language

The el binding prefix allows you to use EL expressions in Tapestry templates. EL is similar to OGNL but has some advantages when using Seam in Tapestry pages and components.
<span jwcid="@Insert" value="el:user.getUsername()"/>

Importing Remoting javascript into your pages

To import Seam javascript responsible for Remoting please use the component Remoting. The parameter include expects a list of Seam component names.
<span jwcid="@seam:Remoting" include="ognl:Bean"/>
<span jwcid="@seam:Remoting" include="ognl:{'Bean','User'}"/>