Skip to content

Tag: spring-mvc

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

Download file with original file name

In my project I am uploading a file. While uploading, I am saving its original file name and extension in a database and saving that file with some GUID on server, generated GUID is also stored in …

Spring DeferredResult setResult causing 404

I am using the new spring 3.2 async servlet requests. All works well except in this one scenario… When someTest() is true spring/tomcat returns a 404. I am not sure how I should go about this or why this happens? I assume it might be because the Servlet Async Context has already been created. Is this a bug or am

Error in Java Import statement “The import javax.validation.constraints.NotNull cannot be resolved”

Iam new to Java and Spring Framework. After developing Spring roo project, I found following errors in class : Iam using STS 3.1.0.RELEASE Can some one guide me what Iam doing and how it can be rectified. Thanks in advance Answer The jar containing this class must be added to the build path of your project:

Stored Procedure returning multiple tables to spring jdbc template

Iam calling a stored procedure from my Spring DAO class using JdbcTemplate. My problem is that, stored procedure returns multiple tables. Is there a way to access multiple tables using Spring JdbcTemplate. If I use jdbcTemplate.queryForList(myStoredProc, new Object[]{parameters} iam getting only first table from the result. My database is SQL Server 2005. Is there any method other than jdbcTemplate for