Solved

alert messages at load time appears when i refresh the page

Posted on 2004-08-22
5
229 Views
Last Modified: 2010-03-31
Hi
  I am using struts and mysql for making the complete web application. for client side handling i am using jave script.
 I have to give alert messages according to the error or work is complete. I did that when any button is pressed according to that control is transferred to action and then according to work happened i set the variable. At load time of the page i check the value of that variable and display the alert message. but when i refresh or move back then same alert message appears. is there any other way so that i can handle the page and display the alert messages.

if u know then please reply me soon
thank you
with regds
0
Comment
Question by:econcepts
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 50 total points
ID: 11867704
Try not to avoid caching the page. Add these lines on the top of your jsp page:

response.setHeader("Cache-Control", "no-cache, post-check=0,
pre-check=0");
response.setHeader("Pragma", "no-cache");
response.setHeader("Expires", "Thu, 01 Dec 1994 16:00:00 GMT");
0
 

Author Comment

by:econcepts
ID: 11867861
Thanx girionis
  but it expires complete back page
  but in that case my page is not appearing i just   want to remove the alert messages for back and refresh.
  so this is not working
  do u have any other solution
0
 
LVL 35

Expert Comment

by:girionis
ID: 11867881
If you refresh the page you can't avoid the alert message. Can you post some relevant code so I have a clearer understanding of what's going on?
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 11869621
response.setHeader ( "Expires", "-1" ) ;
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question