I am in Eclipse and some time ago I was using this method: http://docs.oracle.com/javaee/7/api/javax/servlet/ServletResponse.html#setContentLengthLong(long) Now I can't manage to mek it work. I am using JDK 1.7 and I have inserted the following dependency in pom.xml
:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
I have cleaned and updated the project with Maven. I have even closed and opened Eclipse. When I write:
response.setContentLengthLong(downloadFile.length());
I get:
The method setContentLengthLong(long) is undefined for the type HttpServletResponse
What am I doing wrong?