Search code examples
javaspringtapestry

About /WEB-INF/applicationContext.xml


This is driving me nuts. And this has been probably asked before but....

I've started recently with Tapestry for a Hibernate-Spring-Tapestry project. I used a maven archetype for Hibernate/Tapestry and then added Spring integration but this is giving more problems than I thought.

Currently I'm stuck with this, after adding the right tapestry-spring integration dependency and after changing the filter in /WEB-INF/web.xml I can't get jetty to run. This is because it can't find /WEB-INF/applicationContext.xml, mostly because I don't have that file in my project.

I just want to know what it should contain so I can move on to my next noob error.

EDIT: I've replaced the default Tapestry5 filter with

<filter>
    <filter-name>app</filter-name>
    <filter-class>org.apache.tapestry5.spring.TapestrySpringFilter</filter-class>
</filter>

Full web.xml -> http://pastebin.com/KgPTDrmC


Solution

  • TapestrySpringFilter works by retrieving the WebApplicationContext created and initialized by Spring's ContextLoaderListener (which you should also have). The applicationContext.xml file is a Spring XML bean declaration file which the ContextLoaderListener can use to create that WebApplicationContext.

    The beans that go in it depend on your application.