Solved

alert messages at load time appears when i refresh the page

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
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…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

617 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