이 콘텐츠는 선택한 언어로 제공되지 않습니다.

A.5. War URL Handler


Overview

If you need to deploy a WAR file in an OSGi container, you can automatically add the requisite manifest headers to the WAR file by prefixing the WAR URL with war:, as described here.

Syntax

A War URL is specified using either of the following syntaxes:
war:warURL
warref:instructionsURL
Copy to Clipboard Toggle word wrap
The first syntax, using the war scheme, specifies a WAR file that is converted into a bundle using the default instructions. The warURL can be any URL that locates a WAR file.
The second syntax, using the warref scheme, specifies a Bnd properties file, instructionsURL, that contains the conversion instructions (including some instructions that are specific to this handler). In this syntax, the location of the referenced WAR file does not appear explicitly in the URL. The WAR file is specified instead by the (mandatory) WAR-URL property in the properties file.

WAR-specific properties/instructions

Some of the properties in the .bnd instructions file are specific to the War URL handler, as follows:
WAR-URL
(Mandatory) Specifies the location of the War file that is to be converted into a bundle.
Web-ContextPath
Specifies the piece of the URL path that is used to access this Web application, after it has been deployed inside the Web container.
Note
Earlier versions of PAX Web used the property, Webapp-Context, which is now deprecated.

Default instructions

By default, the War URL handler adds manifest headers to the WAR's META-INF/Manifest.mf file as shown in Table A.2, “Default Instructions for Wrapping a WAR File”.
Expand
Table A.2. Default Instructions for Wrapping a WAR File
Manifest HeaderDefault Value
Import-Packagejavax.*,org.xml.*,org.w3c.*
Export-PackageNo packages are exported.
Bundle-SymbolicNameThe name of the WAR file, where any characters not in the set [a-zA-Z0-9_-\.] are replaced by period, ..
Web-ContextPathNo default value. But the WAR extender will use the value of Bundle-SymbolicName by default.
Bundle-ClassPath
In addition to any class path entries specified explicitly, the following entries are added automatically:
  • .
  • WEB-INF/classes
  • All of the JARs from the WEB-INF/lib directory.

Examples

The following War URL locates version 1.4.7 of the wicket-examples WAR in a Maven repository and converts it to an OSGi bundle using the default instructions:
war:mvn:org.apache.wicket/wicket-examples/1.4.7/war
Copy to Clipboard Toggle word wrap
The following Wrap URL specifies the Web-ContextPath explicitly:
war:mvn:org.apache.wicket/wicket-examples/1.4.7/war?Web-ContextPath=wicket
Copy to Clipboard Toggle word wrap
The following War URL converts the WAR file referenced by the WAR-URL property in the wicket-examples-1.4.7.bnd file and then converts the WAR into an OSGi bundle using the other instructions in the .bnd file:
warref:file:E:/Data/Examples/wicket-examples-1.4.7.bnd
Copy to Clipboard Toggle word wrap

Reference

For more details about the war URL syntax, see the original Pax URL War Protocol documentation.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat