-
Notifications
You must be signed in to change notification settings - Fork 8
/
service.war.html
5276 lines (5275 loc) · 684 KB
/
service.war.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>128 Web Applications Specification - OSGi Compendium 8</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
<link rel="home" href="index.html" title="OSGi Compendium" />
<link rel="up" href="index.html" title="OSGi Compendium" />
<link rel="prev" href="service.jpa.html" title="127 JPA Service Specification" />
<link rel="next" href="service.coordinator.html" title="130 Coordinator Service Specification" />
<meta name="Section-title" content="128 Web Applications Specification" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="shortcut icon" href="images/favicon.png" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="css/custom.css" />
<link rel="stylesheet" type="text/css" href="css/github.css" />
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Ubuntu:regular,bold&subset=Latin" /><script type="text/javascript" src="js/highlight.pack.js"></script><script type="text/javascript" src="js/main.js"></script></head>
<body>
<div id="fullbody">
<div id="header">
<div class="menu-top-container"></div>
<div id="shadow-block"><a class="logo" href="index.html"><img src="images/OSGi.svg" alt="OSGi Working Group Documentation" /><h1>OSGi Compendium Release 8</h1></a></div>
</div>
<div id="mobile-menu-icon">⋮</div>
<div id="column-two">
<div id="content">
<div id="scrollable">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr>
<td width="20%" align="left"><a accesskey="p" href="service.jpa.html">Prev</a>
</td>
<th width="60%" align="center"> </th>
<td width="20%" align="right"> <a accesskey="n" href="service.coordinator.html">Next</a></td>
</tr>
</table>
<hr />
</div>
<div class="chapter">
<div xmlns="" class="titlepage">
<div>
<div>
<h1 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="service.war"></a><span xmlns="" class="number">128</span> Web Applications Specification
</h1>
</div>
<div>
<p xmlns="http://www.w3.org/1999/xhtml" class="releaseinfo">Version 1.0</p>
</div>
</div>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a xmlns="" class="anchor" id="d0e67744"></a><span xmlns="" class="number">128.1</span> Introduction
</h2>
</div>
</div>
</div>
<p>The Java EE Servlet model has provided the backbone of web based
applications written in Java. Given the popularity of the Servlet model,
it is desirable to provide a seamless experience for deploying existing
and new web applications to Servlet containers operating on the OSGi
framework. Previously, the Http Service in the catalog of OSGi compendium
services was the only model specified in OSGi to support the Servlet
programming model. However, the Http Service, as defined in that
specification, is focused on the run time, as well as manual construction
of the servlet context, and thus does not actually support the standard
Servlet packaging and deployment model based on the Web Application
Archive, or WAR format.
</p>
<p>This specification defines the Web Application Bundle, which is a
bundle that performs the same role as the WAR in Java EE. A WAB uses the
OSGi life cycle and class/resource loading rules instead of the standard
Java EE environment. WABs are normal bundles and can leverage the full set
of features of the OSGi framework.
</p>
<p>Web applications can also be installed as traditional WARs through a
manifest rewriting process. During the install, a WAR is transformed into
a WAB. This specification was based on ideas developed in <a xmlns="" class="xref" href="service.war.html#i3102743" title="PAX Web Extender">[5] <em>PAX Web Extender</em></a>.
</p>
<p>This Web Application Specification provides support for web
applications written to the Servlet 2.5 specification, or later. Given
that Java Server Pages, or JSPs, are an integral part of the Java EE web
application framework, this specification also supports the JSP 2.1
specification or greater if present. This specification details how a web
application packaged as a WAR may be installed into an OSGi framework, as
well as how this application may interact with, and obtain, OSGi
services.
</p>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="d0e67757"></a><span xmlns="" class="number">128.1.1</span> Essentials
</h3>
</div>
</div>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p><span class="emphasis"><em>Extender</em></span> - Enable the configuration of
components inside a bundle based on configuration data provided by
the bundle developer.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Services</em></span> - Enable the use of OSGi
services within a Web Application.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Deployment</em></span> - Define a mechanism to deploy
Web Applications, both OSGi aware and non OSGi aware, in the OSGi
environment.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>WAR File Support</em></span> - Transparently enhance
the contents of a WAR's manifest during installation to add any
headers necessary to deploy a WAR as an OSGi bundle.
</p>
</li>
</ul>
</div>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="d0e67781"></a><span xmlns="" class="number">128.1.2</span> Entities
</h3>
</div>
</div>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p><span class="emphasis"><em>Web Container</em></span> - The implementation of
this specification. Consists of a Web Extender, a Web URL Handler
and a Servlet and Java Server Pages Web Runtime environment.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Web Application</em></span> - A program that has web
accessible content. A Web Application is defined by <a xmlns="" class="xref" href="service.war.html#i3076362" title="Java EE Web Applications">[2] <em>Java EE Web Applications</em></a>.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Web Application Archive (WAR)</em></span> - The Java
EE standard resource format layout of a JAR file that contains a
deployable Web Application.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Web Application Bundle</em></span> - A Web
Application deployed as an OSGi bundle, also called a WAB.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>WAB</em></span> - The acronym for a Web Application
Bundle.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Web Extender</em></span> - An extender bundle that
deploys the Web Application Bundle to the Web Runtime based on the
Web Application Bundle's state.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Web URL Handler</em></span> - A URL handler which
transforms a Web Application Archive (WAR) to conform to the OSGi
specifications during installation by installing the WAR through a
special URL so that it becomes a Web Application Bundle.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Web Runtime</em></span> - A Java Server Pages and
Servlet environment, receiving the web requests and translating them
to servlet calls, either from Web Application servlets or other
classes.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Web Component</em></span> - A Servlet or Java Server
Page (JSP).
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Servlet</em></span> - An object implementing the
Servlet interface; this is for the request handler model in the
Servlet Specification.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Servlet Context</em></span> - The model representing
the Web Application in the Servlet Specification.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Java Server Page (JSP)</em></span> - A declarative,
template based model for generating content through Servlets that is
optionally supported by the Web Runtime.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Context Path</em></span> - The URI path prefix of any
content accessible in a Web Application.
</p>
</li>
</ul>
</div>
<div class="figure"><a xmlns="" class="anchor" id="i3084702"></a><p class="title"><strong>Figure <span xmlns="" class="number">128</span>.1 Web Container Entities</strong></p>
<div class="figure-contents">
<div class="mediaobject" align="center"><img src="images/128-web-classes.png" align="middle" width="630" height="273" alt="Web Container Entities" /></div>
</div>
</div><br class="figure-break" /></div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="i3100968"></a><span xmlns="" class="number">128.1.3</span> Dependencies
</h3>
</div>
</div>
</div>
<p>The package dependencies for the clients of this specification are
listed in the following table.
</p>
<div class="table"><a xmlns="" class="anchor" id="d0e67863"></a><p class="title"><strong>Table <span xmlns="" class="number">128</span>.1 Dependency versions</strong></p>
<div class="table-contents">
<table summary="Dependency versions" style="border-collapse: collapse;border-top: 0.5pt solid ; border-bottom: 0.5pt solid ; border-left: 0.5pt solid ; border-right: 0.5pt solid ; ">
<colgroup>
<col />
<col />
<col />
</colgroup>
<thead>
<tr>
<th style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; ">Packages</th>
<th style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; ">Export Version</th>
<th style="border-bottom: 0.5pt solid ; ">Client Import Range</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">javax.servlet</code></td>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">2.5</code></td>
<td style="border-bottom: 0.5pt solid ; "><code class="code">[2.5,3.0)</code></td>
</tr>
<tr>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">javax.servlet.http</code></td>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">2.5</code></td>
<td style="border-bottom: 0.5pt solid ; "><code class="code">[2.5,3.0)</code></td>
</tr>
<tr>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">javax.servlet.jsp.el</code></td>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">2.1</code></td>
<td style="border-bottom: 0.5pt solid ; "><code class="code">[2.1,3.0)</code></td>
</tr>
<tr>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">javax.servlet.jsp.jstl.core</code></td>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">1.2</code></td>
<td style="border-bottom: 0.5pt solid ; "><code class="code">[1.2,2.0)</code></td>
</tr>
<tr>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">javax.servlet.jsp.jstl.fmt</code></td>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">1.2</code></td>
<td style="border-bottom: 0.5pt solid ; "><code class="code">[1.2,2.0)</code></td>
</tr>
<tr>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">javax.servlet.jsp.jstl.sql</code></td>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">1.2</code></td>
<td style="border-bottom: 0.5pt solid ; "><code class="code">[1.2,2.0)</code></td>
</tr>
<tr>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">javax.servlet.jsp.jstl.tlv</code></td>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">1.2</code></td>
<td style="border-bottom: 0.5pt solid ; "><code class="code">[1.2,2.0)</code></td>
</tr>
<tr>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">javax.servlet.jsp.resources</code></td>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">2.1</code></td>
<td style="border-bottom: 0.5pt solid ; "><code class="code">[2.1,3.0)</code></td>
</tr>
<tr>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">javax.servlet.jsp.tagext</code></td>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">2.1</code></td>
<td style="border-bottom: 0.5pt solid ; "><code class="code">[2.1,3.0)</code></td>
</tr>
<tr>
<td style="border-right: 0.5pt solid ; "><code class="code">javax.servlet.jsp</code></td>
<td style="border-right: 0.5pt solid ; "><code class="code">2.1</code></td>
<td style=""><code class="code">[2.1,3.0)</code></td>
</tr>
</tbody>
</table>
</div>
</div><br class="table-break" /><p>JSP is optional for the Web Runtime.</p>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="d0e67981"></a><span xmlns="" class="number">128.1.4</span> Synopsis
</h3>
</div>
</div>
</div>
<p>The Web Application Specification is composed of a number of
cooperating parts, which are implemented by a <span class="emphasis"><em>Web
Container</em></span>. A Web Container consists of:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p><span class="emphasis"><em>Web Extender</em></span> - Responsible for deploying
Web Application Bundles (WAB) to a Web Runtime,
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Web Runtime</em></span> - Provides support for
Servlet and optionally for JSPs, and
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Web URL Handler</em></span> - Provides on-the-fly
enhancements of non-OSGi aware Web ARchives (WAR) so that they can
be installed as a WAB.
</p>
</li>
</ul>
</div>
<p>WABs are standard OSGi bundles with additional headers in the
manifest that serve as deployment instructions to the Web Extender. WABs
can also contain the Java EE defined <code class="code">web.xml</code> descriptor in
the <code class="code">WEB-INF</code>/ directory. When the Web Extender detects that
a WAB is ready the Web Extender deploys the WAB to the Web Runtime using
information contained in the <code class="code">web.xml</code> descriptor and the
appropriate manifest headers. The Bundle Context of the WAB is made
available as a Servlet Context attribute. From that point, the Web
Runtime will use the information in the WAB to serve content to any
requests. Both dynamic as well as static content can be provided.
</p>
<p>The Web URL Handler allows the deployment of an unmodified WAR as
a WAB into the OSGi framework. This Web URL Handler provides a URL
stream handler with the <code class="code">webbundle:</code> scheme. Installing a WAR
with this scheme allows the Web URL Handler to interpose itself as a
filter on the input stream of the contents of the WAR, transforming the
contents of the WAR into a WAB. The Web URL Handler rewrites the
manifest by adding necessary headers to turn the WAR into a valid WAB.
Additional headers can be added to the manifest that serve as
instructions to the Web Extender.
</p>
<p>After a WAB has been deployed to the Web Runtime, the Web
Application can interact with the OSGi framework via the provided Bundle
Context. The Servlet Context associated with this WAB follows the same
life cycle as the WAB. That is, when the underlying Web Application
Bundle is started, the Web Application is deployed to the Web Runtime.
When the underlying Web Application Bundle is stopped because of a
failure or other reason, the Web Application is undeployed from the Web
Run-time.
</p>
</div>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a xmlns="" class="anchor" id="d0e68023"></a><span xmlns="" class="number">128.2</span> Web Container
</h2>
</div>
</div>
</div>
<p>A Web Container is the implementation of this specification. It
consists of the following parts:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p><span class="emphasis"><em>Web Extender</em></span> - Detects Web Application
Bundles (WAB) and tracks their life cycle. Ready WABs are deployed to
the Web Runtime.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Web Runtime</em></span> - A runtime environment for a
Web Application that supports the <a xmlns="" class="xref" href="service.war.html#i3076808" title="Servlet 2.5 specification">[3] <em>Servlet 2.5 specification</em></a> and <a xmlns="" class="xref" href="service.war.html#i3076835" title="JSP 2.1 specification">[4] <em>JSP 2.1 specification</em></a> or later. The Web Runtime receives web requests
and calls the appropriate methods on servlets. Servlets can be
implemented by classes or Java Server Pages.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>Web URL Handler</em></span> - A URL stream handler
providing the <code class="code">webbundle:</code> scheme. This scheme can be used
to install WARs in an OSGi framework. The Web URL Handler will then
automatically add the required OSGi manifest headers.
</p>
</li>
</ul>
</div>
<p>The extender, runtime, and handler can all be implemented in the
same or different bundles and use unspecified mechanisms to communicate.
This specification uses the defined names of the sub-parts as the actor;
the term Web Container is the general name for this collection of
actors.
</p>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a xmlns="" class="anchor" id="d0e68053"></a><span xmlns="" class="number">128.3</span> Web Application Bundle
</h2>
</div>
</div>
</div>
<p>Bundles are the deployment and management entities under OSGi. A
<span class="emphasis"><em>Web Application Bundle</em></span> (WAB) is deployed as an OSGi
bundle in an OSGi framework, where each WAB provides a single
<span class="emphasis"><em>Web Application</em></span>. A Web Application can make use of
the <a xmlns="" class="xref" href="service.war.html#i3076808" title="Servlet 2.5 specification">[3] <em>Servlet 2.5 specification</em></a> and <a xmlns="" class="xref" href="service.war.html#i3076835" title="JSP 2.1 specification">[4] <em>JSP 2.1 specification</em></a> programming
models, or later, to provide content for the web.
</p>
<p>A WAB is defined as a normal OSGi bundle that contains web
accessible content, both static and dynamic. There are no restrictions on
bundles. A Web Application can be packaged as a WAB during application
development, or it can be transparently created at bundle install time
from a standard Web Application aRchive (WAR) via transformation by the
Web URL Handler, see <a xmlns="" class="xref" href="service.war.html#i3100445" title="128.4 Web URL Handler">Web URL Handler</a>.
</p>
<p>A WAB is a valid OSGi bundle and as such must fully describe its
dependencies and exports (if any). As Web Applications are modularized
further into multiple bundles (and not deployed as WAR files only) it is
possible that a WAB can have dependencies on other bundles.
</p>
<p>A WAB may be installed into the framework using the
<code class="code">BundleContext.installBundle</code> methods. Once installed, a WAB's
life cycle is managed just like any other bundle in the framework. This
life cycle is tracked by the Web Extender who will then deploy the Web
Application to the Web Runtime when the WAB is ready and will undeploy it
when the WAB is no longer ready. This state is depicted in <a xmlns="" class="xref" href="service.war.html#i3086869" title="Figure 128.2 State diagram Web Application">Figure <span class="number">128</span>.2</a>.
</p>
<div class="figure"><a xmlns="" class="anchor" id="i3086869"></a><p class="title"><strong>Figure <span xmlns="" class="number">128</span>.2 State diagram Web Application</strong></p>
<div class="figure-contents">
<div class="mediaobject" align="center"><img src="images/128-web-app-states.png" align="middle" width="641" height="193" alt="State diagram Web Application" /></div>
</div>
</div><br class="figure-break" /><div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="i3077053"></a><span xmlns="" class="number">128.3.1</span> WAB Definition
</h3>
</div>
</div>
</div>
<p>A WAB is differentiated from non Web Application bundles through
the specification of the additional manifest header:
</p><pre xmlns="" class="programlisting"><code>Web-ContextPath ::= path</code></pre><p>The Web-ContextPath header specifies the value of the
<span class="emphasis"><em>Context Path</em></span> of the Web Application. All web
accessible content of the Web Application is available on the web server
relative to this Context Path. For example, if the context path is
<code class="code">/sales</code>, then the URL would be something like:
<code class="code">http://www.acme.com/sales</code>. The Context Path must always
begin with a solidus (<code class="code">'/' \u002F</code>).
</p>
<p>The Web Extender must not recognize a bundle as a Web Application
unless the Web-ContextPath header is present in its manifest and the
header value is a valid path for the bundle.
</p>
<p>A WAB can optionally contain a <code class="code">web.xml</code> resource to
specify additional configuration. This <code class="code">web.xml</code> must be
found with the Bundle <code class="code">findEntries</code> method at the
path:
</p><pre xmlns="" class="programlisting"><code> <code xmlns="http://www.w3.org/1999/xhtml" class="code">WEB-INF/web.xml</code></code></pre><p>The <code class="code">findEntries</code> method includes fragments, allowing
the <code class="code">web.xml</code> to be provided by a fragment. The Web Extender
must fully support a <code class="code">web.xml</code> descriptor that specifies
Servlets, Filters, or Listeners whose classes are required by the
WAB.
</p>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="d0e68136"></a><span xmlns="" class="number">128.3.2</span> Starting the Web Application Bundle
</h3>
</div>
</div>
</div>
<p>A WAB's Web Application must be <span class="emphasis"><em>deployed</em></span>
while the WAB is <span class="emphasis"><em>ready</em></span>. Deployed means that the Web
Application is available for web requests. Once deployed, a WAB can
serve its web content on the given Context Path. Ready is when the
WAB:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>Is in the <code class="code">ACTIVE</code> state, or
</p>
</li>
<li class="listitem">
<p>Has a <code class="code">lazy</code> activation policy and is in the
<code class="code">STARTING</code> state.
</p>
</li>
</ul>
</div>
<p>The Web Extender should ensure that serving static content from
the WAB does not activate the WAB when it has a <code class="code">lazy</code>
activation policy.
</p>
<p>To deploy the WAB, the Web Extender must initiate the deploying of
the Web Application into a Web Runtime. This is outlined in the
following steps:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>Wait for the WAB to become ready. The following steps can take
place asynchronously with the starting of the WAB.
</p>
</li>
<li class="listitem">
<p>Post an <code class="code">org/osgi/service/web/DEPLOYING</code> event. See
<a xmlns="" class="xref" href="service.war.html#i3089230" title="128.5 Events">Events</a>.
</p>
</li>
<li class="listitem">
<p>Validate that the <code class="code">Web-ContextPath</code> manifest header
does not match the Context Path of any other currently deployed web
application. If the Context Path value is already in use by another
Web Application, then the Web Application must not be deployed, and
the deployment fails, see <a xmlns="" class="xref" href="service.war.html#i3078658" title="128.3.3 Failure">Failure</a>. The Web
Extender should log the collision. If the prior Web Application with
the same Context Path is undeployed later, this Web Application
should be considered as a candidate, see <a xmlns="" class="xref" href="service.war.html#i3091603" title="128.3.8 Stopping the Web Application Bundle">Stopping the Web Application Bundle</a>.
</p>
</li>
<li class="listitem">
<p>The Web Runtime processes deployment information by processing
the <code class="code">web.xml</code> descriptor, if present. The Web Container
must perform the necessary initialization of Web Components in the
WAB as described in the <a xmlns="" class="xref" href="service.war.html#i3076808" title="Servlet 2.5 specification">[3] <em>Servlet 2.5 specification</em></a>. This involves
the following sub-steps in the given order:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>Create a Servlet Context for the Web Application.</p>
</li>
<li class="listitem">
<p>Instantiate configured Servlet event listeners.</p>
</li>
<li class="listitem">
<p>Instantiate configured application filter instances
etc.
</p>
</li>
</ul>
</div>
<p>The Web Runtime is required to complete instantiation of
listeners prior to the start of execution of the first request into
the Web Application by the Web Runtime. Attribute changes to the
Servlet Context and Http Session objects can occur concurrently. The
Servlet Container is not required to synchronize the resulting
notifications to attribute listener classes. Listener classes that
maintain state are responsible for the integrity of the data and
should handle this case explicitly.
</p>
<p>If event listeners or filters are used in the
<code class="code">web.xml</code>, then the Web Runtime will load the
corresponding classes from the bundle activating the bundle if it
was lazily started. Such a configuration will therefore not act
lazily.
</p>
</li>
<li class="listitem">
<p>Publish the Servlet Context as a service with identifying
service properties, see <a xmlns="" class="xref" href="service.war.html#i3078599" title="128.3.4 Publishing the Servlet Context">Publishing the Servlet Context</a>.
</p>
</li>
<li class="listitem">
<p>Post an <code class="code">org/osgi/service/web/DEPLOYED</code> event to
indicate that the web application is now available. See <a xmlns="" class="xref" href="service.war.html#i3089230" title="128.5 Events">Events</a>.
</p>
</li>
</ol>
</div>
<p>If at any moment before the
<code class="code">org/osgi/service/web/DEPLOYED</code> event is published the
deployment of the WAB fails, then the WAB deployment fails, see <a xmlns="" class="xref" href="service.war.html#i3078658" title="128.3.3 Failure">Failure</a>.
</p>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="i3078658"></a><span xmlns="" class="number">128.3.3</span> Failure
</h3>
</div>
</div>
</div>
<p>Any validation failures must prevent the Web Application from
being accessible via HTTP, and must result in a
<code class="code">org/osgi/service/web/FAILED</code> event being posted. See <a xmlns="" class="xref" href="service.war.html#i3089230" title="128.5 Events">Events</a>. The situation after the failure must be as if the
WAB was never deployed.
</p>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="i3078599"></a><span xmlns="" class="number">128.3.4</span> Publishing the Servlet Context
</h3>
</div>
</div>
</div>
<p>To help management agents with tracking the state of Web
Applications, the Web Extender must register the Servlet Context of the
WAB as a service, using the Bundle Context of the WAB. The Servlet
Context service must be registered with the service properties listed in
the following table.
</p>
<div class="table"><a xmlns="" class="anchor" id="d0e68252"></a><p class="title"><strong>Table <span xmlns="" class="number">128</span>.2 Servlet Context Service Properties</strong></p>
<div class="table-contents">
<table summary="Servlet Context Service Properties" style="border-collapse: collapse;border-top: 0.5pt solid ; border-bottom: 0.5pt solid ; border-left: 0.5pt solid ; border-right: 0.5pt solid ; ">
<colgroup>
<col />
<col />
<col />
</colgroup>
<thead>
<tr>
<th style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; ">Property Name</th>
<th style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; ">Type</th>
<th style="border-bottom: 0.5pt solid ; ">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">osgi.web.symbolicname</code></td>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">String</code></td>
<td style="border-bottom: 0.5pt solid ; ">
<p>The symbolic name for the Web Application
Bundle
</p>
</td>
</tr>
<tr>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">osgi.web.version</code></td>
<td style="border-right: 0.5pt solid ; border-bottom: 0.5pt solid ; "><code class="code">String</code></td>
<td style="border-bottom: 0.5pt solid ; ">
<p>The version of the Web Application Bundle. If no
Bundle-Version is specified in the manifest then this property
must not be set.
</p>
</td>
</tr>
<tr>
<td style="border-right: 0.5pt solid ; "><code class="code">osgi.web.contextpath</code></td>
<td style="border-right: 0.5pt solid ; "><code class="code">String</code></td>
<td style="">
<p>The Context Path from which the WAB's content will
be served.
</p>
</td>
</tr>
</tbody>
</table>
</div>
</div><br class="table-break" /></div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="i3096883"></a><span xmlns="" class="number">128.3.5</span> Static Content
</h3>
</div>
</div>
</div>
<p>A deployed WAB provides content on requests from the web. For
certain access paths, this can serve content from the resources of the
web application: this is called <span class="emphasis"><em>static content</em></span>. A
Web Runtime must use the Servlet Context resource access methods to
service static content, the resource loading strategy for these methods
is based on the <code class="code">findEntries</code> method, see <a xmlns="" class="xref" href="service.war.html#i3082990" title="128.6.3 Resource Lookup">Resource Lookup</a>. For confidentiality reasons, a Web Runtime must
not return any static content for paths that start with one of the
following prefixes:
</p><pre xmlns="" class="programlisting"><code>WEB-INF/
OSGI-INF/
META-INF/
OSGI-OPT/</code></pre><p>These <span class="emphasis"><em>protected directories</em></span> are intended to
shield code content used for dynamic content generation from
accidentally being served over the web, which is a potential attack
route. In the servlet specification, the <code class="code">WEB-INF</code>/ directory
in the WAR is protected in such a way. However, this protection is not
complete. A dependent JAR can actually be placed outside the WEB-INF
directory that can then be served as static content. The same is true
for a WAB. Though the protected directories must never be served over
the web, there are no other checks required to verify that no content
can be served that is also available from the Bundle class path.
</p>
<p>It is the responsibility of the author of the WAB to ensure that
confidential information remains confidential by placing it in one of
the protected directories. WAB bundles should be constructed in such a
way that they do not accidentally expose code or confidential
information. The simplest way to achieve this is to follow the WAR model
where code is placed in the <code class="code">WEB-INF/classes</code> directory and
this directory is placed on the Bundle's class path as the first entry.
For example:
</p><pre xmlns="" class="programlisting"><code>Bundle-ClassPath: WEB-INF/classes, WEB-INF/lib/acme.jar</code></pre></div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="d0e68328"></a><span xmlns="" class="number">128.3.6</span> Dynamic Content
</h3>
</div>
</div>
</div>
<p>Dynamic content is content that uses code to generate the content,
for example a servlet. This code must be loaded from the bundle with the
Bundle <code class="code">loadClass</code> method, following all the Bundle class
path rules.
</p>
<p>Unlike a WAR, a WAB is not constrained to package classes and code
resources in the <code class="code">WEB-INF/classes</code> directory or dependent
JARs in <code class="code">WEB-INF/lib/</code> only. These entries can be packaged in
any way that's valid for an OSGi bundle as long as such directories and
JARs are part of bundle class path as set with the Bundle-ClassPath
header and any attached fragments. JARs that are specified in the
Bundle-ClassPath header are treated like JARs in the
<code class="code">WEB-INF/lib/</code> directory of the Servlet specification.
Similarly, any directory that is part of the Bundle-ClassPath header is
treated like <code class="code">WEB-INF/classes</code> directory of the Servlet
specification.
</p>
<p>Like WARs, code content that is placed outside the protected
directories can be served up to clients as static content.
</p>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="d0e68352"></a><span xmlns="" class="number">128.3.7</span> Content Serving Example
</h3>
</div>
</div>
</div>
<p>This example consists of a WAB with the following contents:</p><pre xmlns="" class="programlisting"><code>acme.jar:
Bundle-ClassPath: WEB-INF/classes, LIB/bar.jar
Web-ContextPath: /acme
WEB-INF/lib/foo.jar
LIB/bar.jar
index.html
favicon.ico</code></pre><p>The content of the embedded JARs <code class="code">foo.jar</code> and
<code class="code">bar.jar</code> is:
</p><pre xmlns="" class="programlisting"><code>foo.jar: bar.jar:
META-INF/foo.tld META-INF/bar.tld
foo/FooTag.class bar/BarTag.class</code></pre><p>Assuming there are no special rules in place then the following
lists specifies the result of a number of web requests for static
content:
</p><pre xmlns="" class="programlisting"><code>/acme/index.html acme.wab:index.html
/acme/favicon.ico acme.wab:favicon.ico
/acme/WEB-INF/lib/foo.jar not found because protecteddirectory
/acme/LIB/bar.jar acme.wab:LIB/bar.jar (code, but not protected)</code></pre><p>In this example, the tag classes in <code class="code">bar.jar</code> must be
found (if JSP is supported) but the tag classes in <code class="code">foo.jar</code>
must not because <code class="code">foo.jar</code> is not part of the bundle class
path.
</p>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="i3091603"></a><span xmlns="" class="number">128.3.8</span> Stopping the Web Application Bundle
</h3>
</div>
</div>
</div>
<p>A web application is stopped by stopping the corresponding WAB. In
response to a WAB <code class="code">STOPPING</code> event, the Web Extender must
<span class="emphasis"><em>undeploy</em></span> the corresponding Web Application from the
Servlet Container and clean up any resources. This undeploying must
occur synchronously with the WAB's stopping event. This will involve the
following steps:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>An <code class="code">org/osgi/service/web/UNDEPLOYING</code> event is
posted to signal that a Web Application will be removed. See <a xmlns="" class="xref" href="service.war.html#i3089230" title="128.5 Events">Events</a>.
</p>
</li>
<li class="listitem">
<p>Unregister the corresponding Servlet Context service</p>
</li>
<li class="listitem">
<p>The Web Runtime must stop serving content from the Web
Application.
</p>
</li>
<li class="listitem">
<p>The Web Runtime must clean up any Web Application specific
resources as per servlet 2.5 specification.
</p>
</li>
<li class="listitem">
<p>Emit an <code class="code">org/osgi/service/web/UNDEPLOYED</code> event.
See <a xmlns="" class="xref" href="service.war.html#i3089230" title="128.5 Events">Events</a>.
</p>
</li>
<li class="listitem">
<p>It is possible that there are one or more
<span class="emphasis"><em>colliding</em></span> WABs because they had the same
Context Path as this stopped WAB. If such colliding WABs exists then
the Web Extender must attempt to deploy the colliding WAB with the
lowest bundle id.
</p>
</li>
</ol>
</div>
<p>Any failure during undeploying should be logged but must not stop
the cleaning up of resources and notification of (other) listeners as
well as handling any collisions.
</p>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="d0e68429"></a><span xmlns="" class="number">128.3.9</span> Uninstalling the Web Application Bundle
</h3>
</div>
</div>
</div>
<p>A web application can be uninstalled by uninstalling the
corresponding WAB. The WAB will be uninstalled from the OSGi
framework.
</p>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="d0e68434"></a><span xmlns="" class="number">128.3.10</span> Stopping of the Web Extender
</h3>
</div>
</div>
</div>
<p>When the Web Extender is stopped all deployed WABs are undeployed
as described in <a xmlns="" class="xref" href="service.war.html#i3091603" title="128.3.8 Stopping the Web Application Bundle">Stopping the Web Application Bundle</a>. Although the WAB is
undeployed it remains in the <code class="code">ACTIVE</code> state. When the Web
Extender leaves the <code class="code">STOPPING</code> state all WABs will have been
undeployed.
</p>
</div>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a xmlns="" class="anchor" id="i3100445"></a><span xmlns="" class="number">128.4</span> Web URL Handler
</h2>
</div>
</div>
</div>
<p>The Web URL Handler acts as a filter on the Input Stream of an
install operation. It receives the WAB or WAR and it then generates a JAR
that conforms to the WAB specification by rewriting the manifest resource.
This process is depicted in <a xmlns="" class="xref" href="service.war.html#i3100518" title="Figure 128.3 Web URL Handler">Figure <span class="number">128</span>.3</a>.
</p>
<div class="figure"><a xmlns="" class="anchor" id="i3100518"></a><p class="title"><strong>Figure <span xmlns="" class="number">128</span>.3 Web URL Handler</strong></p>
<div class="figure-contents">
<div class="mediaobject" align="center"><img src="images/128-webbundle-url-handler.png" align="middle" width="630" height="225" alt="Web URL Handler" /></div>
</div>
</div><br class="figure-break" /><p>When the Web Container bundle is installed it must provide the
<code class="code">webbundle:</code> scheme to the URL class. The Web URL Handler has
two primary responsibilities:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p><span class="emphasis"><em>WAB</em></span> - If the source is already a bundle
then only the Web-ContextPath can be set or overwritten.
</p>
</li>
<li class="listitem">
<p><span class="emphasis"><em>WAR</em></span> - If the source is a WAR (that is, it
must not contain any OSGi defined headers) then convert the WAR into a
WAB.
</p>
</li>
</ul>
</div>
<p>The Web URL Handler can take parameters from the query arguments of
the install URL, see <a xmlns="" class="xref" href="service.war.html#i3086131" title="128.4.3 URL Parameters">URL Parameters</a>.
</p>
<p>The URL handler must validate query parameters, and ensure that the
manifest rewriting results in valid OSGi headers. Any validation failures
must result in Bundle Exception being thrown and the bundle install must
fail.
</p>
<p>Once a WAB is generated and installed, its life cycle is managed
just like any other bundle in the framework.
</p>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="d0e68484"></a><span xmlns="" class="number">128.4.1</span> URL Scheme
</h3>
</div>
</div>
</div>
<p>The Web URL Handler's scheme is defined to be:</p><pre xmlns="" class="programlisting"><code>scheme ::= 'webbundle:' embedded '?' web-params
embedded ::= <embedded URL according to RFC 1738>
web-params ::= ( web-param ( '&' web-param )* )?
web-param ::= <key> '=' <value></code></pre><p>The <code class="code">web-param</code> <<code class="code">key></code> and
<code class="code"><value></code> as well as the <code class="code"><embedded
url></code> must follow <a xmlns="" class="xref" href="service.war.html#i3079490" title="Uniform Resource Locators, RFC 1738">[6] <em>Uniform Resource Locators, RFC 1738</em></a> for their escaping
and character set rules.A Web URL must further follow all the rules of a
URL. Whitespaces are not allowed between terms.
</p>
<p>An example for a <code class="code">webbundle:</code> URL:
</p><pre xmlns="" class="programlisting"><code>webbundle:http://www.acme.com:8021/sales.war?Web-ContextPath=/sales</code></pre><p>Any URL scheme understood by the framework can be embedded, such
as an <code class="code">http:</code>, or <code class="code">file:</code> URL. Some forms of
embedded URL also contain URL query parameters and this must be
supported. The embedded URL most be encoded as a standard URL. That is,
the control characters like colon (<code class="code">':' \u003A</code>), solidus
(<code class="code">'/' \u002F</code>), percent (<code class="code">'%' \u0025</code>), and
ampersand (<code class="code">'&' \u0026</code>) must not be encoded. Thus the
value returned from the <code class="code">getPath</code> method may contain a query
part. Any implementation must take care to preserve both the query
parameters for the embedded URL, and for the complete
<code class="code">webbundle:</code> URL. A question mark must always follow the
embedded URL to simplify this processing. The following example shows an
HTTP URL with some query parameters:
</p><pre xmlns="" class="programlisting"><code>webbundle:http://www.acme.com/sales?id=123?Bundle-SymbolicName=com.example&
Web-ContextPath=/</code></pre></div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="d0e68542"></a><span xmlns="" class="number">128.4.2</span> URL Parsing
</h3>
</div>
</div>
</div>
<p>The <code class="code">URL</code> object for a <code class="code">webbundle:</code> URL must
return the following values for the given methods:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p><code class="code">getProtocol</code> - <code class="code">webbundle</code></p>
</li>
<li class="listitem">
<p><code class="code">getPath</code> - The complete embedded URL
</p>
</li>
<li class="listitem">
<p><code class="code">getQuery</code> - The parameters for processing of the
manifest.
</p>
</li>
</ul>
</div>
<p>For the following example:</p><pre xmlns="" class="programlisting"><code>webbundle:http://acme.com/repo?war=example.war?Web-ContextPath=/sales</code></pre><p>The aforementioned methods must return:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p><code class="code">getProtocol</code> - <code class="code">webbundle</code></p>
</li>
<li class="listitem">
<p><code class="code">getPath</code> -
<code class="code">http://acme.com/repo?war=example.war</code></p>
</li>
<li class="listitem">
<p><code class="code">getQuery</code> -
<code class="code">Web-ContextPath=/sales</code></p>
</li>
</ul>
</div>
</div>
<div class="section">
<div xmlns="" class="titlepage">
<div>
<div>
<h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a xmlns="" class="anchor" id="i3086131"></a><span xmlns="" class="number">128.4.3</span> URL Parameters
</h3>
</div>