Playing JSONP : A basic example to integrate JSONP mechanism in Play Application with the help of play-jsonp-filter module


Knoldus

Playing JSONP

Basic example to integrate JSONP mechanism in Play Application with the help of play-jsonp-filter module

play-jsonp-filter

This filter enables JSONP on your existing API: any resource that returns a JSON content will return a JavaScript fragment if there is an additional callback parameter in the query string.

For example, if the resource /foo gives the following JSON result: {"foo": "bar"}, the resource /foo?callback=f will give the following JavaScript result: f({"foo": "bar"});.

  • Used play-jsonp-filter module to integrate JSONP mechanism
  • Embedded JS & CSS libraries with WebJars.
  • Integrating with a CSS framework (Twitter Bootstrap)
  • Bootswatch-Readable with Twitter Bootstrap to improve the look and feel of the application

Dependency


The play-jsonp-filter module is distributed using Maven Central so it can be easily added as a library dependency in your Play Application’s SBT build scripts, as follows:

"org.julienrf"      %% "play-jsonp-filter"      % "1.2"

Usage


Add the julienrf.play.jsonp.Jsonp filter to your

View original post 76 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s