Excerpt | ||
---|---|---|
| ||
How to OSGi-fy a standard war file. |
...
Most likely the above headers will have to have the following values:
- Bundle-ClassPath :
WEB_-INF/classes
— this will find any class / file in WEB-INF/classeslib/<dependency>.jar
— you should have an entry for each jar you have in your lib directory, where <dependency> is the name of jar
So, as an example the header can look like:
Bundle-ClassPath: WEB-INF/classes,lib/commons-logging.jar,lib/spring.jar
- Import-Package : should contain any package that your web application depends on but is not included into one of your dependencies that you listed in the Bundle-ClassPath header. Usually a war will not include J2EE apis:
javax.servlet
- servlet apijavax.servlet.http
- servlet api
So, as an example the header can look like:
Import-Package: javax.servlet,javax.servlet.http
...