OSGi - How mature is this technology?

前端 未结 4 2071
离开以前
离开以前 2021-01-31 21:10

I have a requirement where I need to share some web resources (jsp, html, js, images, css etc.) across different

4条回答
  •  孤城傲影
    2021-01-31 22:03

    OSGi is a fairly mature technology - this is how all Eclipse plugins are structured. However, the technology has yet to gain traction in the web app space because there are very few servlet containers that support it.

    If you want to read up on it, you should check out Modular Java by Craig Wells, as it gives a fairly good background on OSGi in relation to the Spring Framework.

    With regard to sharing resources, you may want to look into an EAR package. I have successfully used this to deploy multiple WAR files with a common set of resources (for example, a compressed version of Dojo).

    For example, an EAR can look like:

     ear-file/proj1
     ear-file/proj2
     ear-file/config
     ear-file/lib
     ear-file/resources
     ear-file/META-INF
     ear-file/APP-INF
    

    You may also want to read up on the thread .war vs .ear file from a previous stackoverflow post.

提交回复
热议问题