简体   繁体   中英

Extension mechanism for War file

I am looking at the extension mechanism for web application. Specific case being i want to refer jar files at certain location (outside of my war) on my system, and i don't want to duplicate them by merely copying them within my war/lib. To explain this further, via an installer my application will install all modules and libraries having a structure similar to say,

  • App
    • libs
    • module1
    • module2

Now here module1 is a desktop application, containing its own set of specific jars, while common jars are used from the "libs" directory. Similarly module2 is a webapplication(.war) which will have specific jars bundled within the war itself however for the common jars it need to refer the "libs" folder.

I have been doing some reading around packing mechanisms and "Installed Packages" (ie via Extension-List) seems to be the way to achieve this.

Firstly i would like to understand if this is the only option available or are there any other ways which can help me achieve this behavior. Secondly, for Installed Packages the referencing jars need to be present in the jre/lib/ext location only. What this would mean is i will have to copy these common jars into the jre folder. I am not too keen on that option unless that the only way out.

Thanks,
Vicky

Installing stuff into the JRE directory tree is generally a bad idea. It pollutes the JRE installation for other applications, and causes problems for the user / administrator if he/she decides to upgrade the JRE.

For the rest, it is not clear why you think you need to install things outside of the webapp (or the web container). Without this, it is hard to advise you on the best way to proceed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM