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.
Maybe you'll consider it a good idea to handle whitespace and other invalid input then. Perhaps some basic validation of columns 1,2,3 would be desirable as well.