Spring mvc 5.3 not working for #ResponseBody HashMap - spring

Recently we have upgraded tl Spring mvc 5.3 from 4.0.
Controller methods with #ResponseBody as HashMap have stopped working. If we change HashMap to Object, things work.
Any suggestions, whether any extra jars needed for Spring 5 ??

Related

What is the alternative of AbstractControllerUrlHandlerMapping in Spring 4.3+ and 5

We have developed our framework based on Spring 4.2 since few years ago. Now we are planning to migrate Spring Framework to 5.3 but facing some problems. The major problem is that AbstractControllerUrlHandlerMapping not available anymore in Spring 5.3, but in our framework we create some classes extends it. I want to know what is the alternative in Spring 5.3 ? I guess there will be some new annotations else. Any ideas? please.
Spring Deprecated List: https://docs.spring.io/spring-framework/docs/4.3.13.RELEASE/javadoc-api/deprecated-list.html
org.springframework.web.servlet.mvc.support.AbstractControllerUrlHandlerMapping
as of 4.3, in favor of annotation-driven handler methods
We've created our BaseController extends AbstractDetectingUrlHandlerMapping instead of AbstractControllerUrlHandlerMapping, it works perfectly.

spring,jsf and hibernate application : controller and managedbean approch

What is the difference beetween implementing a spring,jsf and hibernate application using managedbean and controller.
I'm working on a project using spring hibernate controller approach and i whould to integrate the jsf to handle the view part but it's unclear for me how to deal with controller and managedbean at the same time because they both happen to have nearly the same role .
My advice is if you want to use JSF use Java EE. If you are sticking with Spring-mvc then use Jquery etc. However checkout the following links:
Spring 4 and JSF In
JSF 2.2, Spring 4 and CDI

Spring 4.3.0.RELEASE, Hibernate 5.0.9.Final, missing SessionFactoryImplementor.getProperties method

I am using Spring 4.3.0.RELEASE together with Hibernate 5.0.9.Final in my app and I keep getting
java.lang.NoSuchMethodError: org.hibernate.engine.spi.SessionFactoryImplementor.getProperties()Ljava/util/Map;
If I update the Hibernate 5.2.0.Final, everything works fine. It seems that Spring 4.3.0 is not compatible with Hibernate 5.0, is that correct ? I was not able to find anything about not supporting Hibernate 5.0.
In Hibernate 5.2, such method exists, in Hibernate 5.0 the method doesn't exist yet (just replace 5.2 with 5.0 in URL):
http://docs.jboss.org/hibernate/orm/5.2/javadocs/org/hibernate/engine/spi/SessionFactoryImplementor.html
I have created simple reproducer:
https://github.com/trepel/spring43-hibernate50-error
Thanks for all your replies.
There is already an issue, SPR-14365, covering that.

Ajax support in Spring MVC 3.0

We are just starting a new web application using Spring MVC 3.0.
We will be using lot of Ajax in our application. I wanted to know if there is any in built support for Ajax (like Struts 2) in Spring MVC 3.0 or do we have to use some third party API like DWR or jQuery?
We have used lot of both DWR and jQuery in our other applications based on Struts 1 and Struts 2. So, we are very familiar with both of them.
Thanks!
Spring mvc 3 supports Ajax. Check this
As explained in the link in Viren Pushpanayagam's answer, the typical way to use ajax with Spring is to use JQuery (or plain JS or other framework, it doesn't matter) to make ajax call, passing necessary parameters. Spring controller handles request and returns JSON (which is very simple in Spring if you just annotate your controller with #ResponseBody and include Jackson Mapper or Gson in your classpath). There is no Spring tag library or other feature that performs the ajax functionality that I am aware of.

JBOSS 5 and Spring 3 Validation Annotations

I have been trying to set up Spring 3 annotation-based validation, guided by http://static.springsource.org/spring/docs/3.0.0.RC3/spring-framework-reference/html/ch05s07.html. I am using JBOSS 5.0.1 server; however, upon invoking the #Valid annotation from the Controller. I received errors and found out it will require javax.validation.*;
Upon adding the validation-api-1.0.0.GA.jar (for javax.validation.*), I received complaints about it requiring Hibernate Validator 4+, which in turn requires Hibernate 3.5+. Finally, I discovered that JBOSS 5 does not support Hibernate 3.5+ because it uses JPA-2 and JBOSS 5 is tightly coupled to JPA-1.
At this point, my brain hurts.
Does anyone have a successful example of using Spring 3 annotation-based validation under JBOSS 5?
I finally figured out the answer to this. I basically reverted to using Hibernate Validator 3.1 using this example:
http://wheelersoftware.com/articles/hibernate-validator-3.html
Hope this helps anybody else.
I just wanted to add one more thing. I managed to wire Hibernate Validator 4.01 to JBOSS 5.01. The steps were as follows:
Remove hibernate-validator.jar from the JBOSS common/lib directory
Insert the validation-api-1.0.0.GA.jar, hibernate-validator-4.1.0.Final.jar into your project's WEB-INF/lib directory.

Resources