前提・実現したいこと
Vueのaxiosを使って
Springのデータ(Form,Model)を受け取りたい
発生している問題・エラーメッセージ
◆Spring側のデータをFormで受け取りたい
【詳細】
下記、1項目ずつなら簡単に取得できます。
vue側
axios.get(
http::/localhost:8080/index,
params: {name: this.name, id: this.id }
)
Spring(Kotlin)側
@GetMapping("/index")
fun getName(
@RequestParam(name) name: String,
@RequestParam(id) id: String){
// 処理
}
下記のように記載するとうまく動作しません
vue側
axios.get(
http::/localhost:8080/index,
params: {form: this.name, form: this.id }
)
Spring(Kotlin)側
@GetMapping("/index")
fun getName(
@RequestParam(form) userForm: UserForm,
{
// 処理
}
どのようにすれば良いでしょうか?
あなたの回答
tips
プレビュー