-
Notifications
You must be signed in to change notification settings - Fork 3
/
composition.html
142 lines (123 loc) · 4.83 KB
/
composition.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>PicoContainer Web - Composition</title>
<style type="text/css" media="all">
@import url("./style/pico.css");
@import url("./style/syntaxhighlighter.css");
</style>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-2268879-1";
urchinTracker();
</script>
<script type="text/javascript" src="./js/prototype.js">
//
</script>
<meta name="verify-v1" content="UsIBiaQhhmjFrBwcJ2n4XIvEImPNG4SMVP365rRcpxE=" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
</head>
<body class="composite">
<div id="banner"><span> <img src="images/picocontainer-web-logo.png" alt="PicoContainer" /> <span
style="font-size: 72px; font-family: Geneva; font-weight: bold;"> <span style="color: rgb(58, 150, 27);">Pico</span><span
style="color: rgb(131, 131, 131);">Container</span> <span style="color: rgb(58, 150, 27);"> Web</span> </span> </span>
<div class="clear"></div>
</div>
<div id="breadcrumbs">
<div class="left">Latest Released Version: 2.3</div>
<div class="clear"></div>
</div>
<div id="leftColumn">
<div id="navColumn">
<h3><a href="http://picocontainer.org"><img src="images/pico-logo.png" hspace="10" align="left" /> <span
style="font-size: 18px; font-family: Geneva; font-weight: bold;"> <span style="color: rgb(131, 131, 131);">Built
on</span><br />
<span style="color: rgb(58, 150, 27);">Pico</span><br />
<span style="color: rgb(131, 131, 131);">Container</span></span></a></h3>
<h1>PicoContainer Web</h1>
<ul>
<li><a href="index.html">Overview</a></li>
<li><a href="news.html">News</a></li>
<li class="currentLink">Composition</li>
<li><a href="scoping.html">Scoping Web Components</a></li>
<li><a href="script-composition.html">Composition by Script</a></li>
<li><a href="javadoc.html">Javadocs</a></li>
<li><a href="downloads.html">Downloads</a></li>
</ul>
<h1>Binding to Web Frameworks</h1>
<ul>
<li><a href="jsf.html">JSF</a></li>
<li><a href="struts2.html">Struts2</a></li>
<li><a href="struts1.html">Struts1</a></li>
<li><a href="webwork2.html">WebWork2</a></li>
<li><a href="webwork1.html">WebWork1</a></li>
</ul>
<h1>Binding to other technologies</h1>
<ul>
<li><a href="remoting.html">Pico Web Remoting</a></li>
<li><a href="axis.html">Axis</a></li>
</ul>
<h1>Hosted by</h1>
<img alt="Hosted at Codehaus" src="images/codehaus-small.gif" width="120" height="40" /><br />
<h1>Tools</h1>
<img alt="Maven" src="images/maven-feather.png" /> <br />
<img alt="Eclipse" src="images/eclipse-logo-white.jpg" width="100" height="40" /> <br />
<img alt="IDEA" src="images/idea88x31_white.gif" /> <br />
</div>
<div id="bodyColumn">
<div id="contentBox">
<div class="section">
<h2>Composition</h2>
<p>PicoContainer Web composition is abstracted via the <a
href="javadoc/core/org/picocontainer/web/WebappComposer.html">WebappComposer</a> interface, which defines how
components are registered at the different webapp scopes - application, session and request. Typically, request-scoped
components are 'actions'.</p>
<div class="source"><pre>
public class ExampleWebappComposer implements WebappComposer {
public void composeApplication(MutablePicoContainer appContainer) {
appContainer.addComponent(CheeseDao.class, InMemoryCheeseDao.class);
}
public void composeSession(MutablePicoContainer sessionContainer) {
sessionContainer.addComponent(CheeseService.class, DefaultCheeseService.class);
}
public void composeRequest(MutablePicoContainer requestContainer) {
// for Struts1 & 2 and Webwork 1 & 2 the request level components are added lazily
// as they have their own XML for defining action mappings.
}
}
</pre></div>
</div>
</div>
</div>
<div class="clear"></div>
<div id="footer">
<div class="right">© 2003-2008 PicoContainer Committers</div>
<div class="clear"></div>
</div>
</body>
<!-- Scripts to highlight code: MUST be left AFTER the body -->
<script language="javascript" src="./js/shCore.js">
//
</script>
<script language="javascript" src="./js/shBrushJava.js">
//
</script>
<script language="javascript" src="./js/shBrushXml.js">
//
</script>
<script type="text/javascript">
// <![CDATA[
var elements = document.getElementsByClassName('source');
elements.each( function(element) {
var content = element.getElementsByTagName('pre')[0].innerHTML;
var classType = /^</.test(content) ? "xml" : "java";
content = "<textarea name=\"code\" class=\"" + classType + "\">"
+ content + "</textarea>";
new Insertion.Before(element, content);
element.remove(element);
});
dp.SyntaxHighlighter.HighlightAll('code', false, false);
// ]]>
</script>
</html>