File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes insert text from servlet to textarea of html Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "insert text from servlet to textarea of html" Watch "insert text from servlet to textarea of html" New topic
Author

insert text from servlet to textarea of html

Pradeep allada
Greenhorn

Joined: Jul 28, 2011
Posts: 17
I have a form page having two textarea fields(t1,t2), one for input(t1) and the other for output(t2) and a button.
I want to know when I click the button I need output of second textarea(t2) from servlet page.
how to do that?
please help me....
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3859

I want to know when I click the button I need output of second textarea(t2) from servlet page. how to do that?

You may need to utilize AJAX here. Send the request to the servlet on the click event through AJAX call, populate the textarea with the response. AJAX Tutorial, if you are not familiar with it.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Pradeep allada
Greenhorn

Joined: Jul 28, 2011
Posts: 17
Thank you Vijitha Kumara for your answer
but I don't know about ajax. Is there any other way to handle this?
bhanu chowdary
Ranch Hand

Joined: Mar 09, 2010
Posts: 256
Pradeep,
whatever you want to display, set it in the most appropriate scope variable and use it in your JSP to display the value in the other textarea.
Pradeep allada
Greenhorn

Joined: Jul 28, 2011
Posts: 17
bhanu chowdary wrote:
appropriate scope variable and use it in your JSP to display the value in the other textarea.


thank you bhanu chowdary it is now working...
bhanu chowdary
Ranch Hand

Joined: Mar 09, 2010
Posts: 256
Welcome
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: insert text from servlet to textarea of html