HighDots Forums  

A weird problem about AJAX+JSP

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss A weird problem about AJAX+JSP in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
shuijiaojiaozhu@gmail.com
 
Posts: n/a

Default A weird problem about AJAX+JSP - 05-08-2006 , 08:13 PM






Do what I say below. You will see the problem.

1.Write a HTML page. There's a button on it. When you click it, send a
request(whatever is ok, for example, "value=1") to a JSP page.
2.Write a JSP page to recieve the request. On the JSP page you should
set a session variable to count how many requests you recieved. Then
show the variable's value on the HTML page by alert.
3.Click the button. Then watch the value returned. You will see the
value is a constant.
4.If you write some output to console in the JSP, you will see the JSP
is only be excuted one time - the first time you click the button.

I tried it on Tomcat5.5 and JBoss4.

I use "get" method to transport the parameters. Does it matter?
Why? and How to solve it?


Reply With Quote
  #2  
Old   
Wojtek Bok
 
Posts: n/a

Default Re: A weird problem about AJAX+JSP - 05-09-2006 , 08:45 AM






shuijiaojiaozhu (AT) gmail (DOT) com wrote:
Quote:
Do what I say below. You will see the problem.

1.Write a HTML page. There's a button on it. When you click it, send a
request(whatever is ok, for example, "value=1") to a JSP page.
2.Write a JSP page to recieve the request. On the JSP page you should
set a session variable to count how many requests you recieved. Then
show the variable's value on the HTML page by alert.
3.Click the button. Then watch the value returned. You will see the
value is a constant.
4.If you write some output to console in the JSP, you will see the JSP
is only be excuted one time - the first time you click the button.

I tried it on Tomcat5.5 and JBoss4.

I use "get" method to transport the parameters. Does it matter?
Why? and How to solve it?
Try changing the value that you send to the JSP page. Maybe the value
you get back from the server, as that should change.

You may be running into a browser cache problem.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.