Top Description Constructors Methods
org.springframework.web.multipart.support

public abstract Class StandardServletPartUtils

extends Object
Class Inheritance
Imports
java.util.ArrayList, .List, jakarta.servlet.http.HttpServletRequest, .Part, org.springframework.beans.MutablePropertyValues, org.springframework.util.LinkedMultiValueMap, .MultiValueMap, org.springframework.web.multipart.MultipartException

Utility methods for standard Servlet Part handling.
Author
Juergen Hoeller
Since
5.3
See Also
HttpServletRequest#getParts(), StandardServletMultipartResolver

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
bindParts(HttpServletRequest
the servlet request
request
,
MutablePropertyValues
the property values to bind to
mpvs
,
boolean
whether to bind empty parts as well
bindEmpty
)

Bind all parts from the given servlet request.

public static MultiValueMap<String, Part>

Returns:

the parts in a MultiValueMap
getParts
(HttpServletRequest
the servlet request
request
)

Retrieve all parts from the given servlet request.

public static List<Part>

Returns:

the parts in a MultiValueMap
getParts
(HttpServletRequest
the servlet request
request
,
String
the name to look for
name
)

Retrieve all parts with the given name from the given servlet request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

StandardServletPartUtilsback to summary
public StandardServletPartUtils()

Method Detail

bindPartsback to summary
public static void bindParts(HttpServletRequest request, MutablePropertyValues mpvs, boolean bindEmpty) throws MultipartException

Bind all parts from the given servlet request.

Parameters
request:HttpServletRequest

the servlet request

mpvs:MutablePropertyValues

the property values to bind to

bindEmpty:boolean

whether to bind empty parts as well

Exceptions
MultipartException:
in case of failures
getPartsback to summary
public static MultiValueMap<String, Part> getParts(HttpServletRequest request) throws MultipartException

Retrieve all parts from the given servlet request.

Parameters
request:HttpServletRequest

the servlet request

Returns:MultiValueMap<String, Part>

the parts in a MultiValueMap

Exceptions
MultipartException:
in case of failures
getPartsback to summary
public static List<Part> getParts(HttpServletRequest request, String name) throws MultipartException

Retrieve all parts with the given name from the given servlet request.

Parameters
request:HttpServletRequest

the servlet request

name:String

the name to look for

Returns:List<Part>

the parts in a MultiValueMap

Exceptions
MultipartException:
in case of failures