View Full Version : Servlet setAttribute issue with ints

12-09-2004, 03:18 PM

I'm trying to pass an int to a jsp script using the following line:

req.setAttribute("first", firstRowNumber);

firstRowNumber is an int defined above. However, it will not allow me to compile this. I am aware that the API says Object not int, however a fellow coder has basically exactly the same code, and exactly the same line, in a piece of his code and it works. How can I get this to work? And if no one knows how to get it working directly, could you tell me how to get around this problem?

Thanks in advance

12-09-2004, 07:35 PM
are you sure int is the correct datatype? Or must it be an Integer?