aboutsummaryrefslogtreecommitdiffstats
path: root/tutorial/tutorial.html
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2004-06-05 16:05:18 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2004-06-05 16:05:18 +0000
commit134ee70a9fd4959cbf6b9b6f3b9d1498247ec1e5 (patch)
treea285eba6f305608f805b36bcb89fecd6e6b00ca9 /tutorial/tutorial.html
parentfa03e04037cdfed164d5cab7025e1b2f9fe03a22 (diff)
downloadjavassist-134ee70a9fd4959cbf6b9b6f3b9d1498247ec1e5.tar.gz
javassist-134ee70a9fd4959cbf6b9b6f3b9d1498247ec1e5.zip
Changed subclasses of javassist.expr.Expr so that $_ is always initialized.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@109 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'tutorial/tutorial.html')
-rw-r--r--tutorial/tutorial.html22
1 files changed, 21 insertions, 1 deletions
diff --git a/tutorial/tutorial.html b/tutorial/tutorial.html
index ce0a40cf..6c260011 100644
--- a/tutorial/tutorial.html
+++ b/tutorial/tutorial.html
@@ -106,7 +106,27 @@ byte[] b = cc.toBytecode();
<p>The default <code>ClassPool</code> returned
by a static method <code>ClassPool.getDefault()</code>
searches the same path that the underlying JVM (Java virtual machine) has.
-The users can expand this class search path if needed.
+<em>If a program is running on a web application server such as JBoss and Tomcat,
+the <code>ClassPool</code> object may not be able to find user classes</em>
+since such a web application server uses multiple class loaders as well as
+the system class loader. In that case, an additional class path must be
+registered to the <code>ClassPool</code>. Suppose that <code>pool</code>
+refers to a <code>ClassPool</code> object:
+
+<ul><pre>
+pool.insertClassPath(new ClassClassPath(this.getClass()));
+</pre></ul>
+
+<p>
+This statement registers the class path that was used for loading
+the class of the object that <code>this</code> referes to.
+You can use any <code>Class</code> object as an argument instead of
+<code>this.getClass()</code>. The class path used for loading the
+class represented by that <code>Class</code> object is registered.
+
+
+<p>
+You can register a directory name as the class search path.
For example, the following code adds a directory
<code>/usr/local/javalib</code>
to the search path: