Any suggestions on a different way to accomplish this?

You can't really rely on the init-param count.  Any time you add a third-party jar to your WAR you run into the possibility that the jar contains a web-fragment.xml with an init param.

But nonetheless, if you can think of another way to do it I'll make the changes.