Jimmy
Jimmy

Reputation: 10341

How to pass data from java backend to html page?

in my backend i use java and i need to display google chart in html page. im using a tool to generate a url by retrieving the data, do some calculation and create a url to retrieve an image for this chart. my question is how could i pass this url to the html page (portlet) from java to this page.

Upvotes: 1

Views: 1593

Answers (2)

deskmore
deskmore

Reputation: 528

use servlet or JSP you can set the response to send values you want.

AJAX use httpRequestXML to send request and can have a callback function to have response

Upvotes: 2

hvgotcodes
hvgotcodes

Reputation: 120138

you would use ajax to invoke the server and request the url. The server does its thing and sends the url back in the response. You would then use javascript to update the dom (i.e. html) on the page.

I recommend using a framework like jquery to make the ajax request and update the DOM. Plenty of examples are online.

Upvotes: 3

Related Questions