tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Lin <tcw00l...@yahoo.com>
Subject Re: Proposal - documentation for configuring ServletContextListener
Date Wed, 14 Aug 2002 11:54:00 GMT

No one has responded, so I'm guessing either people
don't care or documentation isn't high on developers'
list.  Alot of people complain about the lack of
document, so I thought more documentation might not be
a bad thing.

If tomcat doesn't want it, I'll probably find a free
website to post the documentation, though one would
think having it on the same site would make life
easier for developers.

not everyone has the time to search the net for
information, especially if they have a deadline.

peter


--- Peter Lin <tcw00lfel@yahoo.com> wrote:
>  
> I've written a short document on configuring
> servletcontextlistener for tomcat. It's in XML
> format.
> Any and all mistakes are mine, so please feel free
> to
> email me directly. If there aren't any mistakes and
> people think it's worth adding to the existing
> documentation that is fine. If not, that's fine too.
> 
> peter lin 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com> <?xml version="1.0" ?>
> <article>
>   <title>Tomcat 4.0.x - ServletContextListener
> Installation and tips</title>
>   <introduction>
>     This is a quick guide on setting up a
> ServletContextListener for Tomcat. For those not
> familiar with Java, or Tomcat, this guide should
> provide some basic instructions on how to set one
> up. This is not meant to be a comprehensive guild on
> ServletContext API or how to build scalable
> applications. It is meant to address tomcat specific
> configuration and installation issues.
>   </introduction>
>   <section>
>     <heading>Getting started</heading>
>     <paragraph>The first thing you need to do is
> familiarize yourself with &lt;a
>
href="http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContextListener.html"&gt;ServletContextListener
> API&lt;/a&gt;, if you don't already know it. In the
> examples directory, there is are examples for your
> reference.</paragraph>
>   </section>
>   <section>
>     <heading>Basics</heading>
>     <paragraph>In
> "tomcat/webapps/examples/WEB-INF/web.xml" file there
> are two example entries for adding your
> ServletContextListener. The entry generally goes
> after the filters and should look like this:   
> </paragraph>
>     &lt;listener&gt;<br/>
>        
>
&lt;listener-class&gt;listeners.ContextListener&lt;/listener-class&gt;<br/>
>     &lt;/listener&gt;<br/>
>     <br/>
>     <paragraph>You will file the class and java file
> under
> "tomcat/webapps/examples/WEB-INF/classes/listeners"
> directory. There are two examples listeners in the
> directory. The examples are very simple, so you may
> need to search the internet for more complex
> examples to suit your needs.</paragraph>
>     <paragraph>If you're planning on using your
> context listener for the default webapp, make sure
> your entry in "tomcat/conf/server.xml" is correct.
> If you are not using the default "ROOT" directory,
> make sure the path entry in server.xml is the full
> path and not the local path. For
> example:</paragraph>
>     <ul>
>       <li> Correct entry<p/>
>       &lt;!-- Tomcat Root Context --&gt;<br/>
>       &lt;Context path="" docBase="ROOT"
> debug="0"/&gt;<br/>
>       <br/>
>       &lt;!-- Tomcat Root Context (Unix) --&gt;<br/>
>       &lt;Context path=""
> docBase="/usr/local/tomcat/webapps/mydir"
> debug="0"/&gt;<br/>
>       <br/>
>       &lt;!-- Tomcat Root Context (windows)
> --&gt;<br/>
>       &lt;Context path=""
> docBase="c:/tocmat/webapps/mydir"
> debug="0"/&gt;<br/></li>
>       <li> Wrong entry<p/>
>       &lt;!-- Tomcat Root Context (Unix) --&gt;<br/>
>       &lt;Context path="" docBase="mydir"
> debug="0"/&gt;<br/>
>       <br/>
>       &lt;!-- Tomcat Root Context (windows)
> --&gt;<br/>
>       &lt;Context path="" docBase="mydir"
> debug="0"/&gt;<br/></li>
>     </ul>
>     <paragraph>If you use the local (ie relative)
> path, multiple instances of your context listener
> will be created, causing tomcat to create multiple
> instances of your application. If you only want one
> instance of your context listener to start, make
> sure your path is correct. For more tips on writing
> ServletContextListeners, please refer to &lt;a
>
href="http://java.sun.com/products/servlet/download.html"&gt;Servlet
> 2.3 Specification&lt;/a&gt; or visit one of the
> numerous java community sites on the
> internet.</paragraph>
>   </section>
> </article>
> > --
> To unsubscribe, e-mail:  
> <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:tomcat-dev-help@jakarta.apache.org>


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message