Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

alert messages at load time appears when i refresh the page

Posted on 2004-08-22
5
Medium Priority
?
237 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 200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses

661 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