dropwizard-jsonp-bundle

Simple bundle for Dropwizard that adds JSONP support for any resources

Лицензия

Лицензия

Категории

Категории

DropWizard Контейнер Микросервисы JSON Данные
Группа

Группа

com.github.alim-akbashev
Идентификатор

Идентификатор

dropwizard-jsonp-bundle
Последняя версия

Последняя версия

0.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

dropwizard-jsonp-bundle
Simple bundle for Dropwizard that adds JSONP support for any resources
Ссылка на сайт

Ссылка на сайт

https://github.com/alim-akbashev/dropwizard-jsonp-bundle
Система контроля версий

Система контроля версий

https://github.com/alim-akbashev/dropwizard-jsonp-bundle

Скачать dropwizard-jsonp-bundle

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.alim-akbashev/dropwizard-jsonp-bundle/ -->
<dependency>
    <groupId>com.github.alim-akbashev</groupId>
    <artifactId>dropwizard-jsonp-bundle</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.alim-akbashev/dropwizard-jsonp-bundle/
implementation 'com.github.alim-akbashev:dropwizard-jsonp-bundle:0.0.1'
// https://jarcasting.com/artifacts/com.github.alim-akbashev/dropwizard-jsonp-bundle/
implementation ("com.github.alim-akbashev:dropwizard-jsonp-bundle:0.0.1")
'com.github.alim-akbashev:dropwizard-jsonp-bundle:jar:0.0.1'
<dependency org="com.github.alim-akbashev" name="dropwizard-jsonp-bundle" rev="0.0.1">
  <artifact name="dropwizard-jsonp-bundle" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.alim-akbashev', module='dropwizard-jsonp-bundle', version='0.0.1')
)
libraryDependencies += "com.github.alim-akbashev" % "dropwizard-jsonp-bundle" % "0.0.1"
[com.github.alim-akbashev/dropwizard-jsonp-bundle "0.0.1"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
io.dropwizard : dropwizard-core jar 0.8.1

Модули Проекта

Данный проект не имеет модулей.

dropwizard-jsonp-bundle

Simple bundle for Dropwizard that adds JSONP support for any resources. Inspired by JsonWithPaddingInterceptor, but unlike last one it wraps response with callback() if callback arg is set in query string.

Maven

<dependency>
    <groupId>com.github.alim-akbashev</groupId>
    <artifactId>dropwizard-jsonp-bundle</artifactId>
    <version>0.0.1</version>
</dependency>

Usage

Initialize bundle:

public void initialize(final Bootstrap<AppConfiguration> bootstrap) {
    bootstrap.addBundle(new JsonPBundle());
}

Anotate resource using JSONP annotation:

@Path("/something")
public class SomeResource {

  @GET
  @JSONP(queryParam = "thecallback")
  public String get() {
    return "..."
  }

}

The queryParam is optional. Default value is callback.

Jquery Example

$.ajax({
    type: 'GET',
    url: "http://localhost/something",
    jsonp: "thecallback",
    dataType: "jsonp",
    success: function( response ) {
        console.log( response );
    }
});

Версии библиотеки

Версия
0.0.1