Shailesh Gupta

Greenhorn
+ Follow
since May 05, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shailesh Gupta

Hi Martin,

Thanks for the suggestion. but its not working. could u pls be a bit more specific of which setHeader statements should be addHeader statements. because now that i am testing the application at client, the problem of caching is still being faced.

Any one else who can solve the problem will be a gr8 help.

Regards,
Shailesh
17 years ago
JSP

Originally posted by Martin Simons:
look into the no-cache and expires pragma headers.



well i have already done that by puting the code specified below in my JSPs. Its working fine when the Page is accessed using any links, but when the "Back" of the browser is clicked, the browser loads an older version of the page.


response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setDateHeader("Expires", 0); //prevents caching at the proxy server
response.setHeader("Cache-Control", "private"); // HTTP 1.1
response.setHeader("Cache-Control", "no-store"); // HTTP 1.1
response.setHeader("Cache-Control", "max-stale=0"); // HTTP 1.1

The problem is still there so if any 1 can tell me what can 1 do to resolve this, it wud be lot of help.
17 years ago
JSP
Hi All,

Can any one tell me how can we prevent the old page from getting displayed to the user when he clicks the "Back" button of the browser. The old page is getting displayed when the back button is clicked, but I want the page to be loaded from server and not from cache.
Help in this matter will be greatly appreciated.

Thanks & Regards,
Shailesh
17 years ago
JSP
The problem got solved after i added the following code at top of my every JSP page for which I dont want caching to be performed by the client.

<%
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setDateHeader("Expires", 0); //prevents caching at the proxy server
response.setHeader("Cache-Control", "private"); // HTTP 1.1
response.setHeader("Cache-Control", "no-store"); // HTTP 1.1
response.setHeader("Cache-Control", "max-stale=0"); // HTTP 1.1
%>

Now the problem is solved.
Thanks & Regards,
Shail
17 years ago
hi there,

thanks for the answer. but i havent tried it yet as i already found a way without using the suggestion u made. all i did was to call the method which would load the latest data into session before redirecting control to a JSP.

But now I have another problem. The above mentioned problem having being solved at my PC(which is the server) is coming up when I try to run the apication from some other PC. At client side old JSP page gets loaded despite the fact that session contains latest data. I am bemused by this behaviour.

Can any one throw some light on the reason why a browser might load the old page at some instance and on some other loads the new page.

thanks and regards,
shailesh
17 years ago
Hello Guys,

I wanted to know that whats the way of redirecting the control to any JSP page using ''mapping.findForward("success")'' statement and ensuring that when the JSP page to which control is passed gets loaded with latest data again.

basically whats happening now is that when JSP page is displayed it is displaying me the old data. but i want to ensure that when this JSP is displayed it should be loaded again completely. Does any one can tell me how we can do that.

Thanks.
17 years ago
Hey man,

i am having this error thrown while i am using tomcat 4.1. i m at loss as i have no idea why this error is arising. the jars that i m creating are placed under %TOMCAT_HOME%/common/lib and WEB-INF/lib directories of my web-applications. I am using Eclipse 2.1 and Struts framework. Any help to solve the following error would be a great help..I am badly stuck..

java.lang.LinkageError: Class com/patni/peass/bean/user/UserBean violates loader constraints
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at org.apache.catalina.loader.StandardClassLoader.findClass(StandardClassLoader.java:621)
at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:958)
at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:857)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at com.patni.peass.business.user.LoginBusiness.validateUserAndPassword(LoginBusiness.java:33)
at com.patni.peass.action.user.LoginAction.execute(LoginAction.java:74)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:506)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
at java.lang.Thread.run(Thread.java:536)