How to write a Spring/JavaEE/web application insta

2020-07-27 05:39发布

问题:

I am in the process of converting a legacy system into a Spring JavaEE application and have gotten stuck trying to design the install process. Basically when the application starts up, it needs to check whether the database schema exists and other settings and prompt the user to set them step-by-step until everything is setup. (User is assumed to be entirely non technical).

This process doesn't really fit with a Spring MVC style webapp and I think their Webflow might be utter overkill (and only used for the installer). Any thoughts as to decent design pattern or framework to do this?

回答1:

For one of my Open Source projects I have written a basic JavaEE Web Installer. It can be found here: https://github.com/chotchki/pgGallery

In short to write the installer you need the following:

  • A page filter to stop normal site access
  • A listener to fire the appropriate installation when the web app starts. Afterwards you can unblock the site.