请问SpringMVC如何把参数对象的字段转化为GET的URL方式?比如:title=你好&id=1&type=3
public class Tag {
private int id;
private int fid;
private String title;
private int sort;
private String type;
private String type_name;
private String uuid;
private String url;
private String description;
private String src;
private String createTime;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getFid() {
return fid;
}
public void setFid(int fid) {
this.fid = fid;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public int getSort() {
return sort;
}
public void setSort(int sort) {
this.sort = sort;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getType_name() {
return type_name;
}
public void setType_name(String type_name) {
this.type_name = type_name;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getSrc() {
return src;
}
public void setSrc(String src) {
this.src = src;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
}
@Controller
public class TagPageController {
@RequestMapping("tag")
public String navi(ModelMap modelMap,Tag tag,HttpServletRequest req) throws IOException{
return "page";
}
}
访问地址比如是 tag?title=你好&id=1&type=3
怎么在navi方法里对Tag tag参数转化为title=你好&id=1&type=3,
springmvc有没有提供什么快速的方法?
难道要自己手写实现?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
现在都不查文档,直接伸手的吗?
spring ref
找@RequestParam
request.getQueryString.......