File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Wrong Line Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Wrong Line" Watch "Wrong Line" New topic

Wrong Line

Anthony Smith
Ranch Hand

Joined: Sep 10, 2001
Posts: 285
I meant this one. count is an int.
username is a String
data.getSession().setAttribute(username, count);
Junilu Lacar

Joined: Feb 26, 2001
Posts: 6529

Assuming data is an HttpSession, the second parameter of the setAttribute method needs to be an Object, not a primitive. Try this:
setAttribute(userName, new Integer(count));
I agree. Here's the link:
subject: Wrong Line
It's not a secret anymore!