package com.ufox.utils; import com.alibaba.fastjson.JSON; import javax.servlet.http.HttpServletRequest; import java.io.BufferedReader; import java.io.IOException; public class JSONUtils { public static <T>T getInstance(HttpServletRequest request,Class<T> clazz) throws IOException { //获取参数 BufferedReader reader = request.getReader(); String s = reader.readLine(); T t = JSON.parseObject(s, clazz); return t; } }
02-16
993
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-18
1万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
04-13