【发布时间】:2014-09-11 16:00:57
【问题描述】:
PlayFramwork 新手,遇到了障碍。 @https://www.playframework.com/documentation/2.3.x/JavaForms 上的教程显示了通过将表单输入绑定到类来处理表单。但是,我想处理 HTML 表单而不将我的字段绑定到类。
我的表单示例:
<form method="POST" action="form/submit">
<input type="file" name="slider[1][file]" class="thumbnailUpload">
<input type="text" value="http://www.tapiture.com/shop/collection1" name="slider[1][url]" class="form-control">
<input type="file" name="slider[2][file]" class="thumbnailUpload">
<input type="text" value="http://www.tapiture.com/shop/collection1" name="slider[3][url]" class="form-control">
<input type="file" name="slider[2][file]" class="thumbnailUpload">
<input type="text" value="http://www.tapiture.com/shop/collection1" name="slider[3][url]" class="form-control">
</form>
我希望能够像这样在我的操作中处理这个:
String url = form.get("slider")[0]["url"]
我试过了
RequestBody body = request().body();
final Map<String, String[]> values = body.asFormUrlEncoded();
这样做,我只能访问这样的值
value.get("slider[1][url]")
但我明白了
[Ljava.lang.String;@4d36e231
求助!!!!!!
【问题讨论】:
标签: playframework playframework-2.0