AW: [opencms-dev] Problems with <FORM>s and parameters.get

Hanjo Riege Hanjo.Riege at framfab.de
Fri Nov 9 15:22:48 CET 2001


Hi Peter,

the disadvantage of switching the elementcache off is that your system runs
very slow.

And it is so easy to use the element cache ;-)

You just have to overwrite the getCacheDirectives methode in your template
class and return a cacheDirectives object that says how to cache the output.
In your case I think you want to create output that depend on the
html-parameter "name". So you just have to say the elementcache to cache a
variant of your side for each diffrent name-parameter:


    /**
     * gets the caching information from the current template class.
     *
     * @param cms CmsObject Object for accessing system resources
     * @param templateFile Filename of the template file
     * @param elementName Element name of this template in our parent
template.
     * @param parameters Hashtable with all template class parameters.
     * @param templateSelector template section that should be processed.
     * @return <EM>true</EM> if this class may stream it's results,
<EM>false</EM> otherwise.
     */
    public CmsCacheDirectives getCacheDirectives(CmsObject cms, String
templateFile, String elementName, Hashtable parameters, String
templateSelector) {

        // First build our own cache directives.
        CmsCacheDirectives result = new CmsCacheDirectives(true);
        Vector para = new Vector();
        para.add("name");
        result.setCacheParameters(para);
        return result;
    }



Regards

Hanjo



More information about the opencms-dev mailing list