aspose file tools*
The moose likes Servlets and the fly likes Update text area values without page reload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Update text area values without page reload" Watch "Update text area values without page reload" New topic
Author

Update text area values without page reload

robin singal
Ranch Hand

Joined: Jul 18, 2007
Posts: 102
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


Life is short play hard.
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1511
Ajax.


Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
robin singal
Ranch Hand

Joined: Jul 18, 2007
Posts: 102
Is there nothing in the servlets that i can use to do this???
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1511
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.
Soniya Ahuja
Ranch Hand

Joined: Jul 20, 2008
Posts: 83
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


SCJP 1.5 | SCWCD 5 | SCJP 6.0
[url]http://a2zjava.webs.com[/url] - Online training for Java/JSPs and Servlets/SCJP/SCWCD
http://soniyaahuja.webs.com
robin singal
Ranch Hand

Joined: Jul 18, 2007
Posts: 102
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 ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

No. Once the servlet sends its response to the browser, its job is done. Period.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3971
    
  17

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.


Steve
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29287
    
140

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?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4639
    
    5

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
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

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

Joined: Jul 18, 2007
Posts: 102
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Update text area values without page reload
 
Similar Threads
how can i do this in javascript?
Confused...printing a description as entered by the user.
Get typed text in textarea on autorefresh
javascript special characters
Reading a textarea as a stream