struts2 中 读取请求体中的参数的方式

直接上代码备忘:

    public void receivingInformation(){
        
        BufferedReader br;
        HttpServletRequest request = ServletActionContext.getRequest();
        try {
            br = request.getReader();
            String str, aStr = "";
            while((str = br.readLine()) != null){
                aStr += str;
            }
            System.out.println(aStr);
        } catch (IOException e) {
            e.printStackTrace();
        }
        
    }

猜你喜欢

转载自blog.csdn.net/u013558123/article/details/89093122
今日推荐