Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Wrong Line  RSS feed

 
Anthony Smith
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I meant this one. count is an int.
username is a String
data.getSession().setAttribute(username, count);
 
Junilu Lacar
Sheriff
Posts: 11146
160
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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));
Junilu
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!