Spring mvc receive data Array + pojo

Controller
@ RequestMapping ("ask")
@ ResponseBody
public RobotResponse get (RobotRequest robotRequest) {

RobotRequest.java
public class RobotRequest implements java.io.Serializable {
private cn.eastrobot.www.ws.RobotServiceEx.UserAttribute [] attributes;

UserAttribute.java
public class UserAttribute implements java.io.Serializable {
private java.lang.String name;
private java.lang.String value;

Q: how does the foreground pass values can be encapsulated in robotRequest
the values need to be passed in the foreground and encapsulated into the attributes of robotRequest after data

the author has no way

Aug.06,2021

the author has found a way
localhost:8080/ask?question= Hello & userId=litong& attributes [0] .name = platform&attributes [0] .value = weixin
No need to use double quotation marks to enclose values

Menu