Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

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.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
Spring XT Ajax with hibernate and simpleformcontrollers Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring XT Ajax with hibernate and simpleformcontrollers

    Hi,

    I'm new to using spring modules and the xt ajax framework. I've been looking at the samples available on the spring modules site but none seem to do roughly what I need to.

    Our app is going to be spring / hibernate based with the OSIV interceptor. We've got lots of forms for editing and viewing info (SimpleFormControllers). What I'd like to be able to do is:

    1. show a simpleformcontroller page with a form to edit some of the details of the domain model object.
    2. provide buttons /links to expand details of certain parts of the object if it is required to drill down.


    For this example, I'm using a ReplaceContentAction to try to insert a populated <select> into the html and I'm struggling with the applicationContext.xml spring config to get the mappings and interceptors firing correctly. The main problems I see are:
    • The ajax request is fired from the same page that is mapped to a controller so the controller is being fired as well as the Ajax and OSIV interceptors
    • The page isn't updating with the Ajax content, maybe due to the mapping problem?

    Code:
    	<!-- Extends AbstractAjaxHandler -->
    	<bean id="ajaxLoadLegsHandler" class="uk.co.kraya.quark.afas.ajax.LoadLegsHandler">
    		<property name="legDao">
    			<ref bean="legDao" />
    		</property>
    	</bean>
    
    	<bean id="ajaxInterceptor" class="org.springmodules.xt.ajax.AjaxInterceptor">
    	    <property name="handlerMappings">
    	        <props>
    	            <prop key="/routeEdit.html">ajaxLoadLegsHandler</prop>
    	        </props>
    	    </property>
    	</bean>
    
    	<bean id="urlMapping"
    		class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    		<property name="interceptors">
    			<list>
    				<ref bean="ajaxInterceptor" />
    				<ref local="openSessionInViewInterceptor" />
    			</list>
    		</property>
    		<property name="mappings">
    			<props>
    				<prop key="/townList.html">townListController</prop>
    				<prop key="/townEdit.html">townEditController</prop>
    				<prop key="/routeList.html">routeListController</prop>
    				<prop key="/routeEdit.html">routeEditController</prop>
    			</props>
    		</property>
    	</bean>
    Any help would be appreciated!
Working...
X