Solved

alert messages at load time appears when i refresh the page

Posted on 2004-08-22
5
185 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
  • 2
5 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 50 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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:mayankeagle
Comment Utility
response.setHeader ( "Expires", "-1" ) ;
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
countAbc challenge 9 49
ArrayLists in ArrayLists/HashMaps? 4 39
pairs challenge 5 44
backtracking recursion  code 19 39
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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…
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…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now