You can use this demonstration in three different configurations:
Presentation
1. Configuration simple
The list of the countries is generated in memory.
No data base is used.
It is the configuration provided at the beginning.
2. Configuration copy
The list of the countries is generated in memory.
The data base is used only to be populated by the list in memory.
The application detects this configuration automatically and proposes a choice copy from the home page.
3. Configuration data base
The list of the countries is read from the data base.
You should have tested the copy configuration and used successfully the copy in the data base function to be able to use this configuration.
Technic
1. Configuration simple
There is nothing to modify, it is the provided configuration.
2. Configuration copy
In countries-servlet.xml, comment on part ONLY MEMORY OR ONLY DATABASE IMPLEMENTATION. Uncomment on part MEMORY+DATABASE IMPLEMENTATION FOR COPYING FROM MEMORY TO DATABASE.
In applicationContext.xml, comment on part In memory only version. Uncomment on part In memory + Database version for copying
3. Configuration data base
In countries-servlet.xml, comment on part MEMORY+DATABASE IMPLEMENTATION FOR COPYING FROM MEMORY TO DATABASE. Uncomment on part ONLY MEMORY OR ONLY DATABASE IMPLEMENTATION. You thus returned to the starting situation.
In applicationContext.xml, comment on part In memory + Database version for copying. Uncomment on part Database only version.