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.
If any of the reads fail (where you read the column data), just break out of the while loop. Presumably you are then at the end of the file and reading the last 'not correct' line