Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve RequestMapping#params #259

Merged
merged 1 commit into from
Mar 18, 2020
Merged

resolve RequestMapping#params #259

merged 1 commit into from
Mar 18, 2020

Conversation

tangcent
Copy link
Owner

  • resolve org.springframework.web.bind.annotation.RequestMapping#params

docs:

The parameters of the mapped request, narrowing the primary mapping.
<p>Same format for any environment: a sequence of "myParam=myValue" style
expressions, with a request only mapped if each such parameter is found
to have the given value. Expressions can be negated by using the "!=" operator,
 as in "myParam!=myValue". "myParam" style expressions are also supported,
with such parameters having to be present in the request (allowed to have
any value). Finally, "!myParam" style expressions indicate that the
specified parameter is <i>not</i> supposed to be present in the request.
<p><b>Supported at the type level as well as at the method level!</b>
When used at the type level, all method-level mappings inherit
this parameter restriction (i.e. the type-level restriction
gets checked before the handler method is even resolved).
<p>Parameter mappings are considered as restrictions that are enforced at
the type level. The primary path mapping (i.e. the specified URI value)
still has to uniquely identify the target handler, with parameter mappings
simply expressing preconditions for invoking the handler.

solution:

  • !name : append desc "parameter $param should not be present") to the request.
  • name : append a new param to the request or set existed param to required.
  • name!=value : if param present. append desc "should not equal to [$value]" to the param,otherwise append desc "parameter $param should not equal to [$value]") to the request.
  • name=value : append a new param to the request or set existed param to required & valued the given value.

@tangcent tangcent added the type: enhancement New feature or request label Mar 17, 2020
@tangcent tangcent merged commit 18e0893 into master Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant