missingAfterConversion flag for missing request values

Closes gh-26679
This commit is contained in:
Rossen Stoyanchev
2021-03-25 21:30:39 +00:00
parent 2dc203ffdc
commit 1a9556925d
12 changed files with 206 additions and 32 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -126,6 +126,12 @@ public class MatrixVariableMethodArgumentResolver extends AbstractNamedValueMeth
throw new MissingMatrixVariableException(name, parameter);
}
@Override
protected void handleMissingValueAfterConversion(
String name, MethodParameter parameter, NativeWebRequest request) throws Exception {
throw new MissingMatrixVariableException(name, parameter, true);
}
private static final class MatrixVariableNamedValueInfo extends NamedValueInfo {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -101,6 +101,13 @@ public class PathVariableMethodArgumentResolver extends AbstractNamedValueMethod
throw new MissingPathVariableException(name, parameter);
}
@Override
protected void handleMissingValueAfterConversion(
String name, MethodParameter parameter, NativeWebRequest request) throws Exception {
throw new MissingPathVariableException(name, parameter, true);
}
@Override
@SuppressWarnings("unchecked")
protected void handleResolvedValue(@Nullable Object arg, String name, MethodParameter parameter,