jsp with ajax

Reply

Join Date: Nov 2008
Posts: 2
Reputation: ucan_aps is an unknown quantity at this point 
Solved Threads: 0
ucan_aps ucan_aps is offline Offline
Newbie Poster

jsp with ajax

 
0
  #1
Dec 2nd, 2008
hai to all..
help me to solve my problem...
im dng one project..in my project i do have one database.. it wil be updated for every 30seconds.. so i have to display the data from database with thier updates.i mean i would like to display data's in the client browser..whenever there is an update in data base the browser should display the recent datas from database..
here i m using ajax with 30 seconds interval to refresh broswer and making cal to jsp page after 30seconds. so after every 30 seconds ajax wil cal my jsp.. jsp wil retrieve datas from databse..

its running fine and getting refresh for every 30seconds..
bt display's the same data wat displayed in first time..
bec here jsp is compiled servlet(it means jsp with retrieved data wen it is compiled).. so my ajax caling compiled jsp and gives the output from compiled jsp..so its giving same result.. its not giving recent datas..

i explained my problem as much wat i can..

i wil try explain if any one cant get..

help me....
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 1,176
Reputation: stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light 
Solved Threads: 125
Featured Poster
stephen84s's Avatar
stephen84s stephen84s is offline Offline
Veteran Poster

Re: jsp with ajax

 
0
  #2
Dec 2nd, 2008
First thing you could do to help us is get rid of that SMS or Instant Messaging language to let us understand your problem better and get rid of the ".."s we are not playing fill in the blanks here, and finally use a spell check.

Next do not do database connectivity directly inside a JSP. And also paste the code of the JSP you are talking about, cause honestly what you are saying defies logic to me.

Also note when JSP is converted to a servlet, it is not executed. So no data will be fetched at the this time, Its just like when you write a normal Java application, during compile time the code is converted into a class file (it is not executed) and only when you specify "java <main-class-name>" it is executed and thats when the data fetching happens.

Please a sincere suggestion to you is first concentrate on the basics of the language before jumping in to advanced topics. What I have mentioned here would have been covered in any book on JSPs in the first or second chapter itself. The greatest towers in the world stand because they have a strong foundation underneath. Similarly you should never leave out the basics and just jump to advanced topics just to save time, in fact you will end up spending more coming back to the basics each and every time you run into any sort of trouble.
Last edited by stephen84s; Dec 2nd, 2008 at 2:53 am.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."

"How to ask questions the smart way ?"
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 2
Reputation: ucan_aps is an unknown quantity at this point 
Solved Threads: 0
ucan_aps ucan_aps is offline Offline
Newbie Poster

Re: jsp with ajax

 
0
  #3
Dec 2nd, 2008
thanks..
i will do study the basic's..
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC