-要素で使用しようとして@RequestMapping
いconsumes
ます。APIドキュメントContent-Type
を読み取ると、リクエストのヘッダーで機能します。ただし、
@RequestMapping(consumes = "application/x-www-form-urlencoded;charset=UTF-8", value = "/test")
public void test() {
:
}
また
@RequestMapping(consumes = "application/x-www-form-urlencoded;charset=ISO-8859-1", value = "/test")
public void test() {
:
}
違いはありません。リクエストのヘッダーは次のようになります
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
また
Content-Type: application/x-www-form-urlencoded
test()
可能な 4 つの星座すべてで呼び出されます。
ただし、これは、charset
指定した場合、Spring が -part を認識して使用しようとする証拠です。
@RequestMapping(consumes = "application/x-www-form-urlencoded;charset=UTF-x8", value = "/test")
public void test() {
:
}
Web アプリの起動中 (!) に例外が発生します。
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Initialization of bean failed;
nested exception is java.nio.charset.UnsupportedCharsetException: UTF-x8
-elementのドキュメントにproduces
も の使用については言及されていませんが、charset
Google によると一部のユーザーはそれを使用していることに注意してください。
ここで何が起こっているのか、または私が間違っていることの手がかりはありますか?
ところで、これは Spring 3.1.1.RELEASE です。