そのため、Mule ( 3.3.1 ) と Jersey ( 1.6 ) の古いバージョンを使用しています - どちらも非常に新しく、アップグレードできません - と同様の問題があり、Jersey で "charset=UTF-8" を使用して FormParam で "null 2.0"という点で、HTML フォーム データ@POSTは常に編集されますが、(UTF-8 以外の文字セットを強制するために) curlnullを使用しても違いはありません。@FormParamnull
<flow name="repo" doc:name="Repository application">
<inbound-endpoint ref="RepositoryInternalEndpoint">
<not-filter>
<wildcard-filter pattern="/favicon.ico"/>
</not-filter>
</inbound-endpoint>
<!-- All seems fine at this point -->
<!--<custom-interceptor class="TestInterceptor"/>-->
<!-- Inside the RepositoryService class, @FormParam args are null -->
<jersey:resources doc:name="Repository Service Component">
<component>
<spring-object bean="repositoryService"/>
</component>
</jersey:resources>
</flow>
ジャージーが私のリクエストボディを食べているようです。TestInterceptorメッセージ本文と s を含むメッセージ プロパティを単純に出力する (上記のコメントで)を挿入すると@FromParam、期待されるすべてのデータが存在します。ジャージーがこれを行うのを止める方法や、事前にデータを取得する方法はありますか?
予想される@FormParam引数はすべてStringそのままです...
@POST
@Path("/my/url")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.TEXT_HTML)
public Response myMethod(@FormParam("o_serviceId") String serviceId){}
使用したcurlコマンドは
curl -X POST -H "content-type: application/x-www-form-urlencoded" -d "o_serviceId=12345y" localhost:8889/my/url