• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Update text area values without page reload

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

How can i update textarea values without reloading the page. I want to pick up updated values from the database after 15-30 seconds & update text area. Is there anything in the servlets that i can use to update the textarea contents without reloading page. I am using only servlets for web application.

Thanks & Regards
Robin
 
Ranch Hand
Posts: 1609
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ajax.
 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there nothing in the servlets that i can use to do this???
 
Akhilesh Trivedi
Ranch Hand
Posts: 1609
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are not hitting the server again, then you can think of pre-pushing the data (in request or session) and storing it in some javascript variable. After the time-out-calculation at client using javascript you can update the textarea with the javascript variable.
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use Ajax... and it's not much that you need to do to change the values after 15-20 seconds. You'll find plenty of ready to use scripts on the net
 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am hitting the server to find the updated values.
It means there nothing in servlets that i can use to do the job....
I can only use Ajax for that.???

I just need to make sure that there is no solution for this using only servlet api.

Moreover is there anything that rmi(remote method invocation) can help me.

Thanks.

[ August 26, 2008: Message edited by: robin singal ]
[ August 26, 2008: Message edited by: robin singal ]
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No. Once the servlet sends its response to the browser, its job is done. Period.
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might want to look up Pushlets. They are strictly just Servlets that don't close the output stream to the client, then as things on the server side change push more javascript commands to the client. Realistically there is an API to make using them easier.

See this article and search the web. They offer a call-back like alternative to the AJAX poll-type dynamic content.
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Robin,
Well the AJAX will call a servlet so you aren't using it instead of servlets - more in addition to. Why don't you want to use AJAX?
 
Rancher
Posts: 4803
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeanne Boyarsky:
the AJAX will call a servlet so you aren't using it instead of servlets - more in addition to.



What Jeanne said.

AJAX is one of the most over hyped buzzwords in the history of the 'net. Its just HTML. Usually backed up with servlets or php or whatever server technology you want.

The basic HTTP RFCs do not allow updates without a server clank. All AJAX does is do the clanking in the background.
 
Bear Bibeault
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pat Farrell:
AJAX is one of the most over hyped buzzwords in the history of the 'net. Its just HTML.

Not HTML, just JavaScript.
 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All

Originally posted by Jeanne Boyarsky:
Why don't you want to use AJAX?


My Senior told if possible use only Servlets

Thanks All for the useful info. As i don't know anything about Ajax i would do some research and would try to work out a solution with combo of (Servlet & java)

Best Regards
Robin
 
reply
    Bookmark Topic Watch Topic
  • New Topic