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 What's wrong with this line? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What Watch "What New topic

What's wrong with this line?

Anthony Smith
Ranch Hand

Joined: Sep 10, 2001
Posts: 285
int count = Integer.parseInt(data.getSession().getAttribute(username));

username is a String
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
username might be a String, but does data.getSession().getAttribute(String) return a String?
Good Luck,
-Dirk Schreckmann

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
Is username made up of all numbers. You are trying to parse a username into an int called count.
Junilu Lacar

Joined: Feb 26, 2001
Posts: 6218

I think he posted what he actually meant in this thread:
I agree. Here's the link:
subject: What's wrong with this line?