Reputation: 706
I am facing a strange problem in apache tomcat.Suppose when I load a class in jsp file it gives me output but when i change the java file recompile changing class file the changes are not shown by apache tomcat,it shows result of previous class...for eg:
<html>
<head><title>Hello World</title></head>
<body>
Hello World!<br/>
<%@ page import="neww.Simpl" %>
<% Simpl demo = new Simpl();
out.println("Current date : " + demo.retur());%>
<%
out.println("Your IP addresssavxcd is " + request.getRemoteAddr());
%>
</body>
</html>
for the first time it shows correct result now if I change the Simpl.java and recompile it and run this jsp file again tomcat gives me previous result.
P.S. I am sure that the class file is modified.
Upvotes: 0
Views: 153
Reputation: 718768
I think that there is something wrong with what you are doing. In particular:
stop tomcat, delete /temp and /work subdirectories' contents, and start it up again.
I tried that already but no help!! I even tried deleting the class file but then to it gives same output.....
If you deleted the old compiled JSP class file, the work and temp directories and restarted the server .... and still saw the old behaviour, then something must be replacing the new version of the JSP source code with the old version. The only plausible explanation for that is that you are modifying the JSP in-place, and a redeploy (from the WAR?) is clobbering your tweaks. But a redeploy shouldn't happen spontaneously. You must be doing something to cause it.
The only other explanation I can think of is that you are deleting the wrong JSP class files, and it is hard to envisage how that might be happening.
Upvotes: 1