Hi all,
I'm developing a Java webapp using Spring, Spring Security, Tomcat and MySQL. Right now I'm still in a phase where I'm making fairly frequent changes to the database as well as recreating the database to purge test data. Ultimately, this won't be an issue, but is there a way to have a bean that is instantiated or code that is executed to bootstrap the webapp? I'd like to be able to take advantage of IoC functionality to use the same, for instance, PasswordEncoder
that my application uses to populate the original user accounts. Additionally, I'd like to have this script create the database if it doesn't exist, etc. Is there a way to do this? Is there a better way than I'm suggesting? I'm not married to the algorithm I just described, but it's the best way I can think of to convey what I'm looking for.
Thanks in advance!