これが私がやろうとしていることです:
@POST
@Path("/MyPath")
@Produces("text/xml")
@RolesAllowed({"user"})
public Output myMethod (@QueryParam("itemId") long ItemId,
@QueryParam("plannedstartdate") Calendar plannedStartDate,
@QueryParam("plannedreturndate") Calendar plannedReturnDate)
JBoss AS7 を使用しています。私の知る限り、resteasy は JBoss AS7 に統合されています。簡単な休憩サービスを実行できます。
日付を渡すことについて私が見つけた唯一のドキュメントはリンクにあります: http://docs.jboss.org/resteasy/2.0.0.GA/userguide/html/StringConverter.html#StringParamUnmarshaller
指示が明確でないため、これに従って問題を解決することができません。例に示されているように注釈 DateFormat を作成しようとすると、StringParamUnmarshaller が認識されません。どこから入手できるかわかりません。resteasy がすでに JBoss AS7 に統合されている場合、これは認識されないのでしょうか?
私の pom.xml には次の依存関係があります。
<!-- Import the JAX-RS API, we use provided scope as the API is included
in JBoss AS 7 -->
<dependency>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_1.1_spec</artifactId>
<scope>provided</scope>
</dependency>
String から Calendar への変換が行われないため、このメソッドの呼び出しは失敗します。Java を直接呼び出すクライアントが他にもあるため、Calendar の代わりに String を渡したくありません。Rest Callsに日付を渡す方法を手伝ってくれる人はいますか?
ありがとう