cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Atkin <I...@Widelearning.com>
Subject RE: cache problem (i think)
Date Mon, 23 Oct 2000 14:04:00 GMT
robin,

i'm doing something rather wierd, in fact it's a total hack but what can you
do...

i'm trying to use cocoon on a whole load of xml files that sit on a win32
public share.  These files were not written for cocoon, and there are so
many that modification is not feasible.  Therefore i have written my own
producer which does the following:-
1. read xml file as raw text and store in buffer
2. insert appropriate PIs into buffer
3. wrap buffer in inputsource
4. carry on as normal

the xml file is specified in a request parameter in the form of
"file://localhost/UNCPATH"

the xslt file is specified using a relative path from the context, ie
"FILENAME.xslt"
- so that arbitrary transforms can be done

the problem is that if the request URL does not change, i recieve the same
html result no matter whan request parameters i specify.
- if the request URL does change everything works fine

given that I have set cocoon's cache manager to the NoCache class i'm
assuming that the caching is being done on the client side, but I've found
no evidence or solution to this proposition.
- using the meta tags has no effect

here's the getDocument method:-

    public Document getDocument(HttpServletRequest request) throws Exception
{
        String xmlPath = request.getParameter("xmlPath");
        String xsltPath = request.getParameter("xsltPath");
        
        String fileURI = new String("file://localhost/" + xmlPath);
        
        char[] buffer = readFile(xmlPath, xsltPath);
        
        CharArrayReader reader = new CharArrayReader(buffer);
        
        InputSource source = new InputSource(reader);
        
        source.setSystemId(fileURI);
        
        //what's all this about then?
        this.monitor.watch(Utils.encode(request), new File(xmlPath));
        
        return parser.parse(source);
        
    }    

- the readFile() method returns the modified xml as a char array 
- don't understand the 'monitor' stuff
- i'm realising that XSP would be a better route to go down, Per Kreipke's
suggestion, but I don't like giving up, esp when i'm 90% the way there

does this make any sense?
any more info required?

Ian Atkin
Code Monkey & Text File Editor
Wide Learning
ian.atkin@widelearning.com
020-7253-1211

> -----Original Message-----
> From:	Robin Green [SMTP:greenrd@hotmail.com]
> Sent:	23 October, 2000 2:13 PM
> To:	cocoon-users@xml.apache.org
> Subject:	RE: cache problem (i think)
> 
> Ian Atkin <Iana@Widelearning.com> wrote:
> >i had checked the faq @ http://xml.apache.org/cocoon/faqs.html and there
> >isn't a single question on caching on it so I checked the list archives @
> >http://archive.covalent.net/ where there were a few questions that seemed
> >possibly relevant so a mailed the list.
> >
> >as a result of your mail I have re-scanned the faq and still cannot see a
> >cache-related question, have i posted to the wrong list? if so applogies 
> >and
> >which one should I post to?
> 
> No no it's the right list - actually you're sort of right, the question in
> 
> the FAQ that I was thinking of is this one
> 
> http://xml.apache.org/cocoon/faqs.html#faq-nocompile
> 
> which is sort of cache-related.
> 
> >
> >anyway...
> >
> >i think i've found the source of the problem:-
> >
> >when the request URL changes my hack works, when it doesn't the previous
> >results are always displayed - thus caching is happening somewhere based
> on
> >the request URL
> >
> >i am currently unsure whether this is down to cocoon or my client, IE5.
> >
> >i have tried to turn off client-side caching via gui settings and meta
> tags
> >with no success
> >i have set the cocoon cache manager to the NoCache class with no success
> >
> >where am i going wrong?
> 
> I don't know - please give more details of the page that doesn't work,
> e.g. 
> order of processing instructions, anything special that you are doing
> (e.g. 
> redirects), etc. Full copy of the xml would be useful. Sorry I don't 
> remember your original email.
> 
> 
> 
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> 
> Share information about yourself, create your own public profile at 
> http://profiles.msn.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

Mime
View raw message