First of all, notice that we're using the exact same template as we did in HelloWorld 1..
So, let's start by comparing the HelloWorld1a servlet with the previous example. A quick glance will reveal that the only real difference lies in how we are instantiating the Model. Rather than using an inner class, we are instead instantiating a DefaultPropertiesModel. This model takes a reference to a properties file name, in this case
When the model receives a request for data, it looks for the key in the properties file and returns the corresponding value. Pretty simple.
Now, while you probably wouldn't want to do this for data that is dynamic to every request, it does make it easier to handle localization issues where localized static text values are stored in a file. The primary purpose of this example is just to show you how it can be done.