You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Yeray Santana Borges <ys...@doblediezcanarias.com> on 2006/07/28 14:14:20 UTC

Problems reading XML file from Tomcat 5.5, ¿Have Tomcat a file cache?

Hi, i have problems when i read a xml file from tomcat. My application read
this file, make something with it, call a servlet that write the file in
tomcat web directory. After, when my application reading the file again, the
server returned the old copy. I must wait a time, reading again the file for
tomcat returned the new. 

If i reading the file with long time between requests, the server returned
the new file.

I use dom4j for reading the file:

SAXReader saxReader = new SAXReader();
Document doc = saxReader("http://localhost:8080/xml/file.xml");


The error not become for my application, if i running it in local, and pass
the argument for saxReader like a file, the application running ok:

SAXReader saxReader = new SAXReader();
File f = new File ("c:\\tomcat\\websapp\xml\filexml");
Document doc = saxReader(f);

But if i pass a argument like a url string, the server returned a cache
copy.

How can i disabled this cache in tomcat 5.5.9???


Sorry if my english is not correc


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Problems reading XML file from Tomcat 5.5, ¿Have Tomcat a file cache?

Posted by Mark Thomas <ma...@apache.org>.
Christopher Schultz wrote:
> I don't think that Tomcat does any caching like this. Are you using
> something like Cocoon to serve your XML files? Is there any other
> software that could be in there?

Tomcat will cache static resources by default. Please see the
cachingAllowed attribute in
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Problems reading XML file from Tomcat 5.5, ¿Have Tomcat a file cache?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Yeray,

> Sorry if my english is not correc

No problem. We can usually figure out what you're trying to say. I just
hope you understand the response. :)

Let me see if I've got this right:

1. You request an XML file from your server.
2. You process this file and make modifications.
3. You post this file back to the server to update it.
4. The server should take that updated file and write it to the disk.
5. You request the file from the server /again/, and it does not appear
   to have changed, unless you wait for a long time.

Hopefully, I have that correct. So, you problem is:

> How can i disabled this cache in tomcat 5.5.9???

I don't think that Tomcat does any caching like this. Are you using
something like Cocoon to serve your XML files? Is there any other
software that could be in there?

-chris