| Author |
How to use a Scanner in a bean?
|
Paul Adcock
Ranch Hand
Joined: Jan 22, 2011
Posts: 34
|
|
I tried using a Scanner to scan a text file, but despite putting it right in the source folder, ti says it can't find the file. Am I doing something wrong or are beans not allowed to use Scanners?
It seems to only work with an absolute path but I can't give it one if I intend to make it a jar file.
I've placed copies of the file in all sorts of spots in the Nebeams project but it simply can't find it, despite being able to see it from the files window under the projects part in the src package part.
Right now I have it having the user ask for the directory, but that is a pain for the user. However, it will work if I do that.
|
Hi all.
|
 |
Greg Charles
Bartender
Joined: Oct 01, 2001
Posts: 2537
|
|
|
You need to be a bit clearer. You're trying to read a file that's in a jar file? Is that the file it says it can't find? I assume the bean you mean is a JSF managed bean, and thus the connection to JSF, but I don't think you're issue is with JSF, so I'll move this over to our General Java forum.
|
 |
 |
|
|
subject: How to use a Scanner in a bean?
|
|
|