-----Original Message-----
From: Kenny Ma [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 14, 2001 12:51 PM
To: [EMAIL PROTECTED]
Subject: Re: Help ~ Tomcat cache problem


I cant solve ~~
Anyone can solve this problem
seems this is a big problem to many people


Here is an excerpt from a working Tomcat server.xml file (cut down for
brevity of course)
I have left some of the XML tags inside the ContextManager section so
you have some 'context' and can see
where to look for what you need. This was actually the default setting
for the ROOT application anyway.

NOTE: If you are developing your JSP's on a machine that is remote from
the actual Tomcat server then
you may well be suffering from timestamp problems. Tomcat relies on the
Last Changed timestamp of 
the files in question in order to detect that a file has been changed
and so trigger compilation of the JSP file.
Copying of files from one machine to another carries the Last Changed
timestamp with it, if your development machine's
clock is behind the tomcat server's clock then Tomcat may not be able to
pick up the changes.
Make sure that the times on both machines match, clock synchronisation
is the best way of ensuring this.
If you are not working on a Unix/Linux platform, find or write your own
version of touch which will update
the last updated timestamps (this would need to be run on the Tomcat
server though). I recommend the former
solution.

    <ContextManager debug="0" workDir="work" showDebugInfo="true" >

      <!-- ==================== Interceptors ==================== -->

        <!-- 
         ContextInterceptor
className="org.apache.tomcat.context.LogEvents" 
         -->
        
        <RequestInterceptor 
            className="org.apache.tomcat.request.SessionInterceptor"
            noCookies="false" />

        <!-- Find the container ( context and prefix/extension map ) 
             for a request.
          -->
        <ContextInterceptor 
 
className="org.apache.tomcat.context.LoadOnStartupInterceptor" />

      <!-- ==================== Connectors ==================== -->

        <!-- Normal HTTP -->
        <Connector
className="org.apache.tomcat.service.PoolTcpConnector">
            <Parameter name="handler" 
 
value="org.apache.tomcat.service.http.HttpConnectionHandler"/>
            <Parameter name="port" 
                value="80"/>
        </Connector>


        <!-- ==================== Special webapps ====================
-->
        <!-- You don't need this if you place your app in webapps/
             and use defaults. 
             For security you'll also need to edit tomcat.policy

             Defaults are: debug=0, reloadable=true, trusted=false
             (trusted allows you to access tomcat internal objects 
             with FacadeManager ), crossContext=true (allows you to
             access other contexts via ServletContext.getContext())
 
             If security manager is enabled, you'll have read perms.
             in the webapps dir and read/write in the workdir.
         -->

        <!-- THIS IS WHAT YOU ARE LOOKING FOR HERE -->
        <Context path ="/"
                 docBase="webapps/ROOT"
                 crossContext="true"
                 debug="0"
                 reloadable="true" >
        </Context>

        <!-- Virtual host example - 
             In "127.0.0.1" virtual host we'll reverse "/" and 
             "/examples"
             (XXX need a better example )
             (use  "http://127.0.0.1/examples"; )
        <Host name="127.0.0.1" >
           <Context path="/examples" 
                    docBase="webapps/ROOT" />
        </Host>
         -->

    </ContextManager>

Reply via email to