所以我用騾子的舊版本(3.3.1 )和澤西島(1.6) - 非常新的進入和無法升級 - 並且與"null in FormParam with 「charset=UTF-8」 in Jersey 2.0"有類似的問題,因爲HTML表單數據爲@POST
ed始終爲null
,但使用curl(強制使用非UTF-8字符集)沒有區別,我的@FormParam
仍然是null
。如何潛入我的郵件正文過去的球衣,也許用騾子
<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
(在上面的註釋中),它僅僅輸出包括消息正文和@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
用@ FormParam註解的方法的預期'Content-Type'是什麼?你使用了什麼'curl'命令? –
這兩個都添加到問題。 –
謝謝。一切看起來很好,所以它看起來像一個錯誤。您是否可以將您的應用程序部署在更近期的Mule上以查看它是否已解決問題? –