I have to implement a plug-in like mechanism into an existing web application. The point of this is that the application mostly generates forms. But some forms have some special behavior (custom forms that must be explicitly implemented), and we don’t want do pack a new release each time we publish a new custom form.
Now I have a plug-in in form of a jar file, containing .xhtml files (containing JSF components) that I want to load dynamically into my web application.
The effect should be like an OSGi bundle fragment that is loaded, so the file structure of my plug-in extends that one of my original war file loaded by the application server.
Does anybody have experience with that?
Thanks and cheers,
Andreas
Answering my own question: I don’t know if this is the right way, but it’s the only one I can think of and it’s simple: I read the directory, where the plug-ins are located. Then, I add the available jar files to the classloader, read the jar file and extract it’s contents (without .class or .java files) to the temporary folder of the application server. I don’t know if this would work with JSP as they have to be compiled, but it works with JSF.