Announcement Announcement Module
Collapse
No announcement yet.
Tapestry 5 and Spring BlazeDS Integration (1.0.0.RELEASE) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tapestry 5 and Spring BlazeDS Integration (1.0.0.RELEASE)

    Hi!

    How can I use the Spring BlazeDS Integration with Tapestry 5? I tried many things, but I cannot get it up and running. I think there is a problem to tell the web application that /messagebroker/amf (I am using Remoting) should be handled by the MessageBroker instead of Tapestry.

    How do I have to configure the web.xml?
    Mine looks as follows:

    Code:
    <?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>Create Sales</display-name>
    	<context-param>
    		<param-name>tapestry.app-package</param-name>
    		<param-value>tv.px.cs.web</param-value>
    	</context-param>
    	<filter>
    		<filter-name>app</filter-name>
    		<filter-class>org.apache.tapestry5.spring.TapestrySpringFilter</filter-class>
    	</filter>
    	<filter-mapping>
    		<filter-name>app</filter-name>
    		<url-pattern>/*</url-pattern>
    	</filter-mapping>
    	<context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>classpath:/ApplicationContext.cfg.xml</param-value>
    	</context-param>
    	
    </web-app>
    Do I have to modify my AppModule.java (that comes with Tapestry)?

    My approach looks like that, with the result, that I get a 404-Error from Jetty in the Reply of the POST-Request (seeing this in Firebug):

    Code:
    public RequestFilter buildTimingFilter(final Logger log) {
    		return new RequestFilter() {
    			public boolean service(Request request, Response response,
    					RequestHandler handler) throws IOException {
    				long startTime = System.currentTimeMillis();
    
    				try {
    					// The responsibility of a filter is to invoke the
    					// corresponding method
    					// in the handler. When you chain multiple filters together,
    					// each filter
    					// received a handler that is a bridge to the next filter.
    					
    					log.info("Path: " + request.getPath());
    					if (request.getPath().startsWith("/messagebroker")) {
    						return false;
    					}
    					return handler.service(request, response);
    				} finally {
    					long elapsed = System.currentTimeMillis() - startTime;
    
    					log.info(String.format("Request time: %d ms", elapsed));
    				}
    			}
    		};
    	}
Working...
X