Still under development, when needed, please refer tapestry-wiki or email me at enefem at gmx dot net.
You have to set listener in your web.xml that will intercept your spring beans configuration file, something like this:
<context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext.xml</param-value> </context-param> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener>
Then of course, you need the bean configuration itself. Below one is only example:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="person" class="id.co.nincec.dymension.page.Person"> <property name="name"> <value>Nanda Firdausi</value> </property> </bean> </beans>
Now time to see whether our bean can be accessed from Tapestry page. First, let we create the page specification (Home.page).
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE page-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 3.1//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_3_1.dtd">
<page-specification class="org.apache.tapestry.html.BasePage">
<inject property="inuyasha"
object="spring:person" />
</page-specification>
See, how easy to take Spring's bean managed into Tapestry page!! And so natural!!
The page template is trivial, one super-simple-example is like this (Home.html).
<span jwcid="@Insert" value="ognl:inuyasha" />
And we finish!!!