Announcement Announcement Module

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions ( project, this forum has been decommissioned in favour of Spring Extensions one at:

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Costin Leau
SpringSource - Spring Training, Consulting, and Support - "From the Source"
See more
See less
Handlers and Interceptor execution order Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Handlers and Interceptor execution order

    Hi World,

    I'm having a problem with an application using Spring 2.5.4 + Spring MVC + Spring XT Interceptor.

    I've a button adding an object in my model through an AjaxHandler, using Spring XT. Then the updatePublList() method is calling the Spring MVC controller to enable the publiList.jsp to iterate on the new collection and to be integrated in the DIV where the table is displayed.

    The first time I'm pressing the button, nothing's happening but using logs I'm getting this:
    DEBUG AjaxListingController - Ajax listing request handled
    DEBUG AjaxHandler - ## PUBLICATION ADDED ##

    And then the next times I'm pressing the button, I'm getting:
    DEBUG AjaxHandler - ## PUBLICATION ADDED ##
    DEBUG AjaxListingController - Ajax listing request handled

    So, only at the first time, the Handler is called AFTER the controler. So the behavior is, first time nothings appearing, on the next pressure, two ellements appear, and on further preasure it's working fine.
    I discovered it's happening only once on each application restart. I'm using these mapping for more pages, and this behaviour is happenning only on the first try on any of those pages. Once a button has been pressed, it's working fine on any other page.

    Here are my source samples that should help to find the problem.
    Thanks for help.

    On the main JSP:
    <script type="text/javascript" language="javascript" charset="utf-8">
    	function updatePublList(){
    		var response = sendRequest("publi/publiList.htm");
    		var el = document.getElementById('publlist');
    <div id="publlist">
    	<jsp:include page="publiList.jsp"></jsp:include>
    <input type="button" value="Add a publication" onclick="XT.doAjaxAction('addPubli', this, {'str' : this.value}); updatePublList()">
    <c:forEach items="${PubliFormTmp.publications}" var="publ">
    Spring Configuration:
    <bean id="ajaxHandler" class="org.mycompany.web.ajax.AjaxHandler" />
    <bean id="ajaxInterceptor" class="org.springmodules.xt.ajax.AjaxInterceptor">
    	<property name="handlerMappings">
    			<prop key="/*.htm">ajaxHandler</prop>			
    <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping" autowire="no">
    	<property name="interceptors">
    			<ref bean="ajaxInterceptor" />
    	<property name="mappings">
    			<prop key="/publi.htm">/publi/publi.htm</prop>
    			<prop key="/publi/publiList.htm">/publi/publiList.htm</prop>
    <bean name="/publi/publiList.htm" class="org.mycompany.web.controlers.AjaxListingController">
    	<property name="view" value="publi/publiList" />
    <bean name="/publi/publi.htm" class="org.mycompany.web.controlers.PubliFormController" autowire="byName">
    	<property name="sessionForm" value="true" />
    	<property name="commandName" value="PubliForm" />
    	<property name="commandClass" value="org.mycompany.web.form.PubliForm" />
    	<property name="formView" value="publi/publi" />
    	<property name="successView" value="litho.htm" />