All Questions

19
votes
4answers
51789 views

Spring 4 - addResourceHandlers not resolving the static resources

My maven spring project directory structure is shown below. I am using Spring-4 annotation based configuration. I configure the resources like below. I tried many ways that are suggested in many Stack...
36
votes
6answers
56233 views

How to return JSON data from spring Controller using @ResponseBody

Spring version 4.2.0, Hibernate 4.1.4 Here is my Controller function: @RequestMapping(value = "/mobile/getcomp", method = RequestMethod.GET) @ResponseBody public List<Company> listforCompanies...
2
votes
1answers
6301 views

Spring 4 RestController JSON: characteristics not acceptable according to the request "accept" headers

I am using spring 4.1.1.RELEASE and have included: jackson-core-asl 1.9.13 and jackson-mapper-asl 1.9.13 in pom to create a simple app with a RestController. Here is the repo: https://github.com/robi...
26
votes
1answers
16400 views

WebSocket with Sockjs & Spring 4 but without Stomp

Is there a way to use WebSockets with SockJS client and Spring 4 server but not using STOMP? Based on this tutorial from Spring's website, I know how to set up a WebSocket based application using Sto...
33
votes
2answers
20034 views

AbstractMethodError on deploying Spring 4.0 in Tomcat 6

I am getting below exception on deploying Spring 4.0.1 app in Tomcat 6.0.37: SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextL...
5
votes
1answers
7342 views

HibernateTemplate is throwing java.lang.NoSuchMethodError: org.hibernate.Session.getFlushMode() -- Spring4.2.6, Hibernate5.2

I have looked around similar postings with SessionFactory and missing Main(). My problem is not related to them. Not sure if any jar is a mismatch. I am trying a sample Spring4.2.6 with Hibernate5.2 c...
19
votes
4answers
4990 views

Programmatic SchemaExport / SchemaUpdate with Hibernate 5 and Spring 4

With Spring 4 and Hibernate 4, I was able to use Reflection to get the Hibernate Configuration object from the current environment, using this code: @Autowired LocalContainerEntityManagerFactoryBean ...
3
votes
2answers
6766 views

How to turn on annotation driven validation in Spring 4?

I am using the annotation validation as below: public String processRegistration(@Valid Spitter spitter, Errors errors, Model model) { if (errors.hasErrors()) { re...
70
votes
3answers
98200 views

When use ResponseEntity<T> and @RestController for Spring RESTful applications

I am working with Spring Framework 4.0.7, together with MVC and Rest I can work in peace with: @Controller ResponseEntity<T> For example: @Controller @RequestMapping("/person") @Profile("...
31
votes
2answers
20428 views

When use AbstractAnnotationConfigDispatcherServletInitializer and WebApplicationInitializer?

I am working with Spring 4.0.7 I did a research about configure Spring MVC through JavaConfig. Practically until yesterday I have seen two configurations using these two options extends AbstractAn...

Previous Next