Hi, I'm trying to integrate AJAX on SpringMVC.
I red the tutorial on this link: https://springmodules.dev.java.net/d...l/xt.html#ajax
I created this handler
and my spring-servlet.xml is this:Code:import java.util.LinkedList; import java.util.List; import org.springmodules.xt.ajax.action.ReplaceContentAction; import org.springmodules.xt.ajax.component.Option; import org.springmodules.xt.ajax.AbstractAjaxHandler; import org.springmodules.xt.ajax.AjaxActionEvent; import org.springmodules.xt.ajax.AjaxResponse; import org.springmodules.xt.ajax.AjaxResponseImpl; import springmvc.domain.Product; import springmvc.service.ProductManager; public class LoadProductsHandler extends AbstractAjaxHandler{ private ProductManager productManager; @SuppressWarnings("unchecked") public AjaxResponse loadProducts(AjaxActionEvent event){ List<Product> list = productManager.getListProduct(); List options = new LinkedList(); Option first = new Option("-1", "Select one ..."); options.add(first); for(Product product : list) { Option option = new Option(product, "description", "price"); options.add(option); } ReplaceContentAction action = new ReplaceContentAction("products", options); AjaxResponse response = new AjaxResponseImpl(); response.addAction(action); return response; } public void setProductManager(ProductManager productManager) { this.productManager = productManager; } }
When I try to start the application I catch this exception:Code:<!-- AJAX --> <bean id="ajaxInterceptor" class="org.springmodules.xt.ajax.AjaxInterceptor"> <property name="handlerMappings"> <props> <prop key="/jsp/loadProducts.jsp">ajaxLoadProductsHandler</prop> </props> </property> </bean> <bean id="ajaxLoadProductsHandler" class="springmvc.ajax.LoadProductsHandler"> <property name="productManager" ref="productManager"/> </bean>
GRAVE: Allocate exception for servlet springmvc
java.lang.NoClassDefFoundError: Could not initialize class org.springmodules.xt.ajax.AjaxInterceptor
Why? I put the correct jar in the WEB-INF/lib.
Anyone can help me?



