spring-framework / org.springframework.web.bind / ServletRequestUtils / getRequiredBooleanParameters

getRequiredBooleanParameters

open static fun getRequiredBooleanParameters(request: ServletRequest, name: String): BooleanArray

Get an array of boolean parameters, throwing an exception if not found or one isn't a boolean.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e. parses leniently).

Parameters

request - current HTTP request

name - the name of the parameter

Exceptions

ServletRequestBindingException - a subclass of ServletException, so it doesn't need to be caught