Solved

alert messages at load time appears when i refresh the page

Posted on 2004-08-22
5
225 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
hibernate example for saving data 19 76
Is Applet the way to go for my drag and drop system? 8 35
junit example issue 2 25
Netbeans and org.apache.commons.lang3 issue 3 25
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…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
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.

749 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