Code Archive Skip to content Google About Google Privacy Terms
This page has moved to a https://eclipse-ee4j.github.io/jersey/.
JaveEE6に対応しているGlassfish 3.0を使う方が手っ取り早いとは思いますが、、サーブレットコンテナとしてTomcat6.0を使った環境でJAX-RSを使ってみます。 JAX-RSの実装としては、JavaによるRESTfulシステム構築では、Jersey, Apache CXF, JBoss RESTEasyなんかが紹介されています。CXFはJAX-WSも含んでいて大きそうなので、今回は参照実装であるJersey 1.5を使ってみます。前提としてMavenを使ったWebアプリケーションのプロジェクトがあるとします。 pom.xmlでの依存ライブラリの追加 pom.xmlにrepositoryとdepenencyを追加します。jersey-jsonはJSONを使用する場合に追加します。Jacksonが使われるようです。 <repositories> <!-- 省略 --> <r
標準のAPIを使ってプログラムを書いておくと色々と都合がいいので、RESTfulなWebサービスを作成しようとするときはJAX-RSを使いたいものです。 JavaEE6には初めから入っているJAX-RSですが、現場ではTomcat5.5(もちろんJava5です)とかが頑張っているのでそのままでは使えません。Apache Tomcat 5.5 と、JAX-RSのリファレンス実装である Jersey 1.4 を使って、単純なRESTサービスを実装する手順を紹介します。 インストールする まずはJersey1.4のインストールから。Maven2を使っている場合は、java.netのリポジトリを設定します。 (pom.xml に以下を追加) <repositories> <repository> <id>maven2-repository.dev.java.net</id> <name>Java.
RESTのWebサービスを作ろうと思い、Apache CXFを動かしてみました。 CXFをダウンロードして、samplesのjax_rs/basicをサンプルにある独自のサーバでは無く、warの構造にしてjettyで実行してみます。 まずは、pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>jp.uniquevision</groupId>
IntroductionJAX-RS: Java API for RESTful Web Services is a Java programming language API that provides support in creating web services according to the Representational State Transfer (REST) architectural style. CXF supports JAX-RS 2.1 (JSR-370), 2.0 (JSR-339) and 1.1 (JSR-311). CXF 3.2.0 supports JAX-RS 2.1. All existing JAX-RS 2.0 and 1.1 applications can be run with CXF 3.2.0. CXF 3.1.x and 3.
Jettison is a collection of Java APIs (like STaX and DOM) which read and write JSON. This allows nearly transparent enablement of JSON based web services in services frameworks like CXF or XML serialization frameworks like XStream. There are currently two included conventions for mapping JSON to XML. The first, is BadgerFish which implements the full XML infoset in JSON using various techniques. T
『RESTful Java with JAX-RS』が届いた。アマゾンに目次がのってないので、参考までに。 Foreword Preface PartI. REST and the JAX-RS Standard 1.Introduction to REST(RESTへどうぞ - winplusの日記) REST and Rebirth of HTTP RESTful Architectural Principles Wrapping Up 2.Designing RESTful Services(RESTfulサービスを設計する - winplusの日記) The Object Model Model the URIs Defining the Data Format Assigning HTTP Methods Wrapping Up 3.Your First JAX-RS Servi
クライアントAPIを使ってRESTサービスにアクセスする 前回はJSR 311: JAX-RSのJBoss Communityによる実装「RESTEasy」を紹介した。このRESTEasyには、サーバ用のAPIだけでなく独自実装としてクライアントアプリケーション側からRESTサービスを利用するためのフレームワークが付属している。 RESTEasyのクライアントフレームワークは、サーバ側と同じアノテーションを用いてサービス利用のためのインタフェースを定義できるのが特徴だ。すなわち@Pathや@GETや@Producesなどのアノテーションを使ってインタフェースを定義し、それを介して実際のRESTサービス呼び出すのが一般的なプログラミングの流れとなる。使用するアノテーションが同じであるため、サーバ側とクライアント側で共通のインタフェースを利用できるという利点もある。 たとえば、前回の例で作成し
List of Examples2.1. Simple hello world root resource class2.2. Specifying URI path parameter2.3. PUT method2.4. Specifying output MIME type2.5. Using multiple output MIME types2.6. Specifying input MIME type2.7. Deployment agnostic application model2.8. Reusing Jersey implementation in your custom application model2.9. Deployment of your application using Jersey specific servlet2.10. Using Jersey
August 16, 2010 The @twitterapi team will be shutting off basic authentication on the Twitter API. All applications, by this date, need to switch to using OAuth. Read more » Don't fret! @twitterapi is here to help! Feel free to reach out to us directly, or via our Twitter Development Talk group. The switch to OAuth is a good thing! You, as the application developer, don't have the burden of keepin
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く