RenegadeAndy
RenegadeAndy

Reputation: 5690

Calling Groovy or Java from JavaScript

I have a cool bit of dojo running where I click a button and it brings a success message on the screen via JavaScript. Is it possible to issue a call to a server-side Groovy script (eg. foo.groovy) from within this JavaScript?

Not only do I want to show the cool success message, but I need to do some work in the background at that point also.

Upvotes: 2

Views: 2528

Answers (2)

rewbs
rewbs

Reputation: 1990

Here are some relevant links from the Dojo documentation:

  • Intro to AJAX and Dojo
  • Dojo.xhrGet() reference: sends a GET request to the server-side resource (which can be a Groovy script or anything else that resides on the server). The live examples on this page are currently broken, but I'm told this is being resolved.
  • Dojo.xhrPost() reference: sends a POST request. There are variants for PUT and DELETE too.

Upvotes: 2

RenegadeAndy
RenegadeAndy

Reputation: 5690

The answer was to use dojo's AJAX call system.

Upvotes: 0

Related Questions