You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by vm...@apache.org on 2005/01/23 10:24:20 UTC
cvs commit: jakarta-cactus/documentation/docs/xdocs faq.xml
vmassol 2005/01/23 01:24:20
Modified: documentation/docs/xdocs faq.xml
Log:
Added FAQ entry about using init(config) for initializing the servlet context/config.
Revision Changes Path
1.30 +17 -0 jakarta-cactus/documentation/docs/xdocs/faq.xml
Index: faq.xml
===================================================================
RCS file: /home/cvs/jakarta-cactus/documentation/docs/xdocs/faq.xml,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- faq.xml 30 Dec 2004 23:22:30 -0000 1.29
+++ faq.xml 23 Jan 2005 09:24:20 -0000 1.30
@@ -102,6 +102,9 @@
<li>
<jump anchor="faq_https_support">Does Cactus support HTTPS?</jump>
</li>
+ <li>
+ <jump anchor="faq_init_servlet">Why is my ServletContext and ServletConfig null in the servlet under test?</jump>
+ </li>
</ul>
</section>
@@ -630,6 +633,20 @@
arguments for HTTPS support and a patch, we might change our
collective mind :-)
</p>
+ </section>
+
+ <anchor id="faq_init_servlet"/>
+ <section title="Why is my ServletContext and ServletConfig null in the servlet under test?">
+ <p>
+ You must initialize the servlet with the implicit cactus config
+ object (see the
+ <link href="site:howto_testcase_servlet">ServletTestCase
+ principles</link> documentation for more details). For example:
+ </p>
+<source><![CDATA[
+MyServlet servlet = new MyServlet();
+servlet.init(config);
+]]></source>
</section>
</body>
---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org