Hall Nation

+ Follow
since Jun 30, 2009
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Hall Nation

Well Peter,

Nevermind, there were lots of Issues going the XAMPP way, so I just installed Tomcat separately and all is fine now.

I used instructions from http://www.scribd.com/doc/495993/Installing-Apache-Tomcat-6-and-Using-It-With-Eclipse and it was just a walk-in-the-park..


I have one small quirk though..
Let's just say I'm trying a basic 'Dynamic Web Application' in Eclipse (I have the Java EE Developers' package installed), with a basic helloworld servlet like this : http://codepad.org/KzSB4m6z. Everytime, I need to put in the .CLASS that gets generated in the 'eclipse_workspace> proj_name > build > classes ' into 'eclipse_workspace> proj_name > WebContent' manually. Is there an automatic setting that does this ? I find that only by manually copying the .CLASS file to the location I mentioned does it work, otherwise it refuses to.
I'm using the local instance of Apache Tomcat from within Eclipse.
I'm trying to run my first servlet through eclipse, I'm using XAMPP + Tomcat add-on as my webserver. How do I even try and compile my servlet ? I've added the external jar Servlet-api.jar to my project as stated in here, http://www.theserverside.com/discussions/thread.tss?thread_id=37924
But eclipse wouldn't compile it, because there just isn't a main() in my servlet program..

Do I need to install the WPT plugin for eclipse? I'm guessing I'm not setting my CLASSPATH correctly - Do I need to set it up manually?
Aight. This is my question :

Now, I need to read a file (whose contents may keep changing over the course of the 100 seconds). Everytime I read the contents of the file, I need to get the new data (that's been added).
PS : No data will be deleted from the file. Data would only be added.

So, I assume I require to mark an offset and read from that offset until I encounter EOF. Every single time. How do I do this?

I'm using BufferedReader and there's this method :

But, I do not know the len (length of characters) to be read each time. Remember, I need to read till EOF everytime. Someone suggested me to use the ready() method of BufferedReader, but I'm lost and do not know how to use it. Can someone put up a prototype example depicting this situation?

One other suggestion was not to use ready() but read until I encounter an Exception.. How do I use it if I want to go this way?
11 years ago
I tried the program again with the two new lines below :

instead of

Curiously, I also faced the same problem as the OP faced. It wouldn't take the bulb image in the specific path (eventhough it was present), but the menu et all did work. The original program worked like a charm though. Still trying to figure out why the other approach didn't work.
11 years ago
It works fine for all of us.
Any specific IDE that you use?

Only thing we can think of, is wrong path for the "images" folder.. OR wrong image name.
11 years ago