1

I have a text area(*id="txtResults"*) in my jsp page. The servlet program retrieves data from an ontology and stores it in a string(*name=solution*). I just want a simple way to transfer this string to the jsp page and print it in the text area without refreshing the whole page. Help would be appreciated!

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
galahad
  • 209
  • 1
  • 4
  • 14

3 Answers3

0

From your tag ajax lies the answer ,

i guess you are not aware where to start with , here is the link jQueryAjax

And also nice startup examples How to use Servlets and Ajax? and here

Hope this helps !!

Community
  • 1
  • 1
Santhosh
  • 8,181
  • 4
  • 29
  • 56
0

Use jQuery Ajax i.e. Asynchronous JavaScript and XML

AJAX is about loading data in the background and display it on the webpage, without reloading the whole page

Go through Ajax documentation Documentation

here you will get some examples

Harshal Patil
  • 6,659
  • 8
  • 41
  • 57
0

As suggested by Sam Krish, Ajax is the best way to do it (LOTs of APIs are there for AJAX.. Jquery is one. If you ready to write one on your own XMLHttpRequest is ypur key. http://www.w3schools.com/xml/xml_http.asp ).

if you working in some legacy code.. then the same can be accomplished using IFrames (Please do not use this way).

When comes to passing data to the Servlet .. its as simple as any GET or POST. you can embed the data as part of the URL and call the request.getParameter in the servlet to retrieve the data.