Skip to content
Advertisement

Tag: spring

How to return a text file with Spring MVC?

The string is generated inside the Controller. What I want is to send back to the user a Window where he can save a file which contains the myString. It clearly doesn’t work in this current state and I am stuck at the moment. Answer here is a sample: PS: don’t forget to put some random stuff in your url

JDBCTemplate set nested POJO with BeanPropertyRowMapper

Given the following example POJO’s: (Assume Getters and Setters for all properties) One can easily query a database (postgres in my case) and populate a list of Message classes using a BeanPropertyRowMapper where the db field matched the property in the POJO: (Assume the DB tables have corresponding fields to the POJO properties). I’m wondering – is there a convenient

MySQL: Unknown system variable ‘tx_read_only’

I’m working on a Java Swing-based application+ Hibernate+Mysql+Spring. When I test CRUD operations, I don’t have problems with read, but in insert statements system shows the message: I have the last version of MySQl Hibernate 4 Java annotations Can you tell me which is the problem to solve now? Answer Just throwing rocks to the darkness, but one possibility could

Spring fails to inject entity manager factory

I writing tests for my DAO classes using JPA, with Hibernate as JPA provider, and Spring 3.2. I am not able to inject the entity manager correctly, I get a NullPointerException when trying to access it. My GenericDAO implementation looks like this: The class of the test looks like this: My root-context.xml is the following: I’ve tried several approaches without

How to pass two objects to use in a form using thymeleaf?

My problem is the following : I’ve 2 differents objects that I’ve to fill from a single form. With 1 object, I simply do in the newFoo.html: and in the FooController: Let’s say I’ve an other object bar with a “status” variable in it. How can I do to pass that object so I can submit the input within the

Advertisement