Reputation: 1030
Let me start off by saying that I'm completely new to JSP and servlets. I'm using Eclipse and Tomcat 7. I tried the answer given on this question: JSP page is not getting refreshed after updating, but it still doesn't update.
Here is my jsp file:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Hello world</title>
</head>
<body>
<%="Hello World JSP"%>
</body>
</html>
When I run this, the appropriate "Hello World JSP" is output. However if I change the string and run it again, the same old output is displayed. I have to restart Eclipse in order to have the output change, so I'm assuming eclipse is caching the compiled page. Any ideas?
EDIT: The problem has been narrowed down to the Browser cache. The problem only occurs when I use Eclipse's "Internal Web Browser" (Doesn't matter which browser I link that to in preferences). When I run it externally, (through either IE or Firefox), the changes are made.
I'd still like to know however how I can make it so that it updates even using "Internal Web Browser", since it's more convenient.
Upvotes: 2
Views: 10632
Reputation: 31
Just came across this thread. In order to solve this issue, you may need to open up the source code file relating to your JSP page. Make some miniscule change (for instance, add a space, and then remove it) and SAVE the page. Refresh the webpage that you are running locally. The change should be there.
Upvotes: 0
Reputation: 146
Just DELETE your old SERVER(local server like 'Tomcat'). And then again create NEW SERVER.
Upvotes: 1
Reputation: 2225
Check if the broswer is the one caching your page contents even though Tomcat republishes.
Clear your browser's cache to see if this helps.
Also, you can put your browser in a cache-less mode in their options:
Firefox: Go to Tools menu -> Options -> Advanced tab -> Network subTab and set the value to 0 in the 'Limit cache to #MB of space' field after checking the 'Ignore automatic cache administration' field.
Chrome: In the Chrome configuration page, go to the Privacy section and click on the 'Content settings' button. In the appearing dialog change the selected option on the Cookies section to any other option that suits your needs.
Eclipse's Internal Web Browser: Check this question's accepted answer to see how to do it.
Upvotes: 1