当使用resteasy处理multipart/form-data请求时,我该如何控制最大文件大小和/或最大请求大小?
我的代码看起来像这样:
@POST
@Path("/somerestresource")
@Consumes(MediaType.MULTIPART_FORM_DATA)
public Response handleForm(@MultipartForm MyForm form) {
...
}
通过使用@MultipartConfig
注解,我可以使用Servlet来控制一些东西。
因此,我考虑绕过resteasy,并使用@Context
注入HttpServletRequest
,并在web.xml中配置我的Servlet,但我不确定会有什么副作用。