473,407 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Why is Tomcat caching content for six seconds?

Hi,

I have a JSP application on Tomcat that performs XSL transformations on
an XML file using the xtags-1.0 taglib. Basically, I have an 'edit' page
that displays a table of entities from my XML file. Each row has a link
to a 'delete' page that removes the row from the XML file itself and
then forwards back to the edit page to display the updated table.

My problem is that the deleted row is displayed when the edit page
reloads. A copy of the XML file is apparently cached on the server for
about six seconds. The XML file itself written immediately to disk, but
I can hit my browser's refresh button any number of times within those
six seconds and I only ever get the cached copy. This occurs on both my
edit page and the direct URL to the XML file. After six seconds (with or
without any intervening browser reload attempts), the updated content
becomes available on the Tomcat server and the next reload attempt
produces the desired result.

I have discounted the possibility of browser caching and I have tried
various Tomcat configuration options without success.

I'm running Tomcat 4.0.6 on Linux 2.4.20 under the NetBeans 3.5 IDE and
using Mozilla 1.3 for the browser. I have also experienced the same
behavior with Tomcat 4.1.24 (no NetBeans) on both Windows and Linux. My
JSP sources are attached.

What's going on here? Is there any way that I can invalidate Tomcat's
cached instance of the XML content or otherwise force it to reload the
file from disk? Any suggestions greatly appreciated.

Steve

--- delete.jsp ---

<%@ page contentType="text/html" %>
<%@ taglib uri="http://jakarta.apache.org/taglibs/xtags-1.0"
prefix="xtag" %>

<xtag:parse uri="/config/events.xml" id="eventList"/>
<xtag:remove select="//*[name()='Event' and
@identifier=$param:identifier]"/>

<%
String fileName = "/home/adams/myapp/web/config/events.xml"
FileWriter output = new java.io.FileWriter(fileName);
eventList.write(output);
output.close();
%>

<jsp:forward page="edit.jsp" />

---
--- edit.jsp ---

<%@ page contentType="text/html" %>
<%@ taglib uri="http://java.sun.com/jstl/x" prefix="x" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

<c:import url="http://localhost:8081/config/events.xml" var="xml"/>
<c:import url="http://localhost:8081/config/events.xsl" var="xsl"/>

<x:transform xml="${xml}" xslt="${xsl}">
<x:param name="doEdit" value="true"/>
</x:transform>

---

Jul 17 '05 #1
0 5891

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Cyrus D. | last post by:
Hi guys, Let's say I have a page that is primarily HTML but I added a few small parts that are PHP, for example a random banner. The page is in no way PHP driven, it just has some some random...
0
by: Sameer | last post by:
Hello All, I have a simple JSP which looks like this <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <%@ page session="true"%> <HTML> <HEAD> <meta HTTP-EQUIV="refresh"...
5
by: darrel | last post by:
I have bits of content on a site that's running of a basic CMS system I've built. The main content on each page is pulled in from the DB, so there's at least one call to the DB on each page...
1
by: Jerad Rose | last post by:
I have been struggling with this for years, and have recently become determined to find a solution for this. If anyone has *any* ideas about this, please offer your suggestions. Basically, I am...
3
by: Purti Malhotra | last post by:
Hi All, In our Web hosting environment we are using Virtual hosting i.e. multiple websites are on one server and multiple domains are pointing to a single website. Issue: We have two domains...
1
by: ashok2006 | last post by:
Hi everybody, Here is my problem:- When I start tomcat the command prompt for tomcat openes but closes within seconds. I've following environment varibles set:- CATALINA_HOME ...
2
by: aptenodytesforsteri | last post by:
I have an ASP.NET 2.0 application I've localized to English, French, German, and Italian. I used resource (.resx) files. Most of the site is static content, easily 90% of it, so I thought...
0
docdiesel
by: docdiesel | last post by:
The fastest (and cheapest) transfer of data is that which doesn't have to be done - because the data is already there. Or still there - the caching of files is widely known and practised. Each web...
2
by: Ken Fine | last post by:
I have a question about ASP.NET output caching. I want to use screen scraping as a temporary hack to pull in some complex Classic ASP-rendered content into some ASP.NET pages: protected String...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.