Question: I have recently been introduced to the Velocity project.

I have written a template and have run it as a simple Java application.

Integration within my existing web project has not been that easy.

Can anyone supply a cookbook for integrating Velocity and Tomcat?

Thanks all!

Answer: 
EOF is not a prediction but an error state. Hence, you can't use it like you're using it now, to predict whether you can read Column 1, 2 and 3. For that reason, a common pattern in C++ is:

```
while (input >> obj1 >> obj2) {
  use(obj1, obj2);
}

```

All `operator>>(istream& is, T&)` return the inputstream, and when used in boolean context the stream is "true" as long as the last extraction succeeded. It's then safe to use the extracted objects.
Don't worry about the number of times that you loop: just validate your data and handle invalid inputs.

Basically, check that you have three columns to read and if you don't decide if it's because the file is over or because of some other issue.