0

My task is to transfer the code from the old project to the new Spring Boot project. Unfortunately i have a problem. In the old project, there was a servlet that worked with this code:

@Override
public void doGet(HttpServletRequest request) throws IOException {
      int result = request.getInputStream().read(); // result > -1 depends on the request
}

In a springboot project:

@RequestMapping(value = "/**")
public void handleRequest(HttpServletRequest request) throws Exception {
      int result = request.getInputStream().read(); // always return -1
}

How to get the valid InputStream from HttpServletRequest in SpringBoot project?

Sasha
  • 81
  • 5

1 Answers1

0

You said me your request is multipart/form-data. So you should rewrite the rest controller.

See the following examples:

Michel Foucault
  • 1,724
  • 3
  • 25
  • 48