-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
173 lines (153 loc) · 6.55 KB
/
index.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
<!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 - Overview</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 class="currentLink">Overview</li>
<li><a href="news.html">News</a></li>
<li><a href="composition.html">Composition</a></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>Overview</h2>
<p>This introduction to web applications follows on from the PicoContainer <a
href="http://picocontainer.org/scopes.html">scopes</a> page</p>
<p>There are only about a million Java web-frameworks for Java. There more recent and sophisticated ones try to do
Dependency Injection for 'actions' or 'controllers'.</p>
<p>The most logical and commonly adopted paradigm when using Dependency Injection in a web framework is to define
three container, one for each webapp scope:
<ul>
<li><strong>application-scoped</strong> container: the root container created when the context is initialized</li>
<li><strong>session-scoped</strong> container: the session container, created when the session is initialized,
and having the application container as its parent</li>
<li><strong>request-scoped</strong> container: the request container, created upon each request, and having the
session one as its parent.
</p>
</li>
</ul>
</p>
<p>The <a href="javadoc/core/org/picocontainer/web/WebappComposer.html">WebappComposer</a> interface allows the user
to define which components are registered at each scope. These can either be defined programmatically, ie in Java, or
read from scripts using the <a href="javadoc/core/org/picocontainer/web/script/ScriptedWebappComposer.html">ScriptedWebappComposer</a>.</p>
<p>The <a href="javadoc/core/org/picocontainer/web/PicoServletContainerListener.html">org.picocontainer.web.PicoServletContainerListener</a>
is the servlet listener that manages te instantiation, assembly and disposal of the the appropriate PicoContainers when
applications/sessions start/stop. It actually creates a single instance of the scoped containers as the web app loads.
For the application one, caching is set. For the session and request level ones, we store instantiated components for
those scopes in ThreadLocal. For the session container, the same components are stored in the HttpSession as an
attribute.</p>
<p>Here is an example of a web.xml:</p>
<div class="source">
<pre>
<web-app>
<context-param>
<param-name>webapp-composer-class</param-name>
<param-value>org.picocontainer.web.sample.ExampleWebappComposer</param-value>
</context-param>
<filter>
<filter-name>picoFilter</filter-name>
<filter-class>org.picocontainer.web.PicoServletContainerFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>picoFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.picocontainer.web.PicoServletContainerListener</listener-class>
</listener>
</web-app>
</pre>
</div>
<p>The above web.xml may not be sufficient for all web frameworks. Refer to the left menu for details of each supported web framework.</p>
</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>