Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

refresh every two minutes in jsp

 
Vasantha Prabha
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
CAn any one tell.Is it possible to refresh my jsp page for every two minutes !.Can any ine give me the code for that
Regards,
Sangeetha
 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use HTML META-TAGS to do this.
In your JSP include the following line with in the header section

Or alternativly you can also use the HTTP headers instead of equivalient HTML META Tags.

In both the cases, the number 120 denotes the number of seconds (2 minutes in this case) and the URL denotes the page you want to refresh.
[ November 21, 2003: Message edited by: Mani Ram ]
 
Vasantha Prabha
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Iam developing a chat site where I am using an vector in an
application variable to store the chat Info When every time
any user type an new Info (it's a general chat screen ) that is
added to the application vector and displayed to every user accessing this
site.
What Iam doing is Iam just refreshing the site for every second
.But what I want is I want to refresh my site only when any
user types new Info.Is that possible Can any one help me out for this

Regards,
Sangeetha
 
kishore harindran
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the user types new , then u again reload ur jsp by calling javascript function as follows :
function frmReload(){
document.form.action = "#";
document.form.submit();
}
 
Vasantha Prabha
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi what I want is When a change is made the site refreshment should be
visible for all the client whoever logged in the chat.
I think the refresh way u have told will only refresh the session of that
paticular person.
Regards,
Sangeetha
 
Vasantha Prabha
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey can any one help.Is Iam clear with my question
sangeetha
 
S. Ganapathy
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sangeetha,
For chatting are you using applet? (applet will solve the refreshing problems using event handling)
Why can't you use ArrayList instead of Vector?
Regards,
Gasnapathy,S
 
Vasantha Prabha
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Iam not using applet .Iam using jsp& html as my client side view.
why you are asking me to use arraylist that vector .How does it helps
sangeetha
 
S. Ganapathy
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sangeetha,
Vector uses legacy code, and ArrayList is not. More over all methods in a Vector are synchronized. So using ArrayList gives a performance boost. If you use Vector as a member variable, you can use List list = Collections.synchronizedList(new ArrayList()); which is equivalent to vector.
In methods, prefer to use ArrayList instead of Vector. It is just a good programming practice.
Regards,
Ganapathy,S
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!