Hi Shinobu,

Thanks for your notes, but I still can't turn the cacheing off.

This is my code............



protected Properties loadConfiguration(ServletConfig objConfig) throws
IOException, FileNotFoundException
    {
        Properties objProps = new Properties();
        String sPath = objConfig.getServletContext().getRealPath("/");
        if (sPath == null) {
            System.out.println(ERR_HEADER + "Unable to get the current
webapp root");
            sPath = "/";
        }
        objProps.setProperty("file.resource.loader.path", sPath +
"/templates");
        objProps.setProperty("file.resource.loader.cache", "false");

objProps.setProperty("file.resource.loader.modificationCheckInterval", "5");
        objProps.setProperty("runtime.log", sPath + "/log/corrman.log" );
        return objProps;
    }

public Template handleRequest(HttpServletRequest objRequest,
HttpServletResponse objResponse, Context objContext) {

        objContext.put("Title", "Hello Steve");

        Template objOutput = null;
        try {
            objOutput = getTemplate("test.vm");
        }
        catch (ParseErrorException objParseErr) {
            System.out.println(ERR_HEADER + "Parse error for template " +
objParseErr.getMessage());
        }
        catch (ResourceNotFoundException objResErr) {
            System.out.println(ERR_HEADER + "Template not found " +
objResErr.getMessage());
        }
        catch (Exception e) {
            System.out.println(ERR_HEADER + e.getMessage());
        }
        return objOutput;
    }
}

What am I doing wrong ?

Thanks,

Steve



-----Original Message-----
From: Shinobu Kawai [mailto:[EMAIL PROTECTED]
Sent: 22 October 2004 14:42
To: Velocity Users List
Subject: Re: Template Cacheing


Hi Steve,

> I'm using Tomcat 4.x and my servlet extends VelocityServlet.  This is
> working fine except that changes to my templates made whilst Tomcat is
> running are not made apparent in Velocity i.e. Velocity is cacheing the
> template and doesn't re-read it until I close Tomcat and re-start it.  Why
> is this and what can I do to defeat it?
First, I suggest using VelocityViewServlet.
    http://jakarta.apache.org/velocity/tools/view/index.html
Next, snoop around these documents and posts about resource loaders and
cache.

http://jakarta.apache.org/velocity/developer-guide.html#Configuring%20Resour
ce%20Loaders
    http://article.gmane.org/gmane.comp.jakarta.velocity.user/7783

If you still can't get it to work, ask again with some detail of how
you configured the resource loader.

Best regards,
-- Shinobu Kawai

--
Shinobu Kawai <[EMAIL PROTECTED]>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to