Home> Java> javaTutorial> body text

Recommended articles about @PathVariable

黄舟
Release: 2017-06-13 10:52:00
Original
1692 people have browsed it

In series (4) we introduced how to use @RequestParam to bind data. Let's take a look at how to use other data binding annotations. 1.@PathVariable is used to bind URL template variable values. We have already introduced how to use this in series (3) and will not go into details here. 2.@CookieValue is used to bind data in Cookie. Next we use the sessionId in the cookie to do the test: add cookiebind action in DataBindController, the code is as follows: //@CookieValue Test@RequestMapping(value="/cookiebind", method = {RequestMethod.GET})public String cookieBind(HttpServletRequest request, &

1.SpringMVC Learning Series (5) Data Binding-2

Recommended articles about @PathVariable

##Introduction: In series (4) we introduced how to use @RequestParam to bind data. Let’s take a look at how to use other data binding annotations 1. @PathVariable is used to bind. Determine the URL template variable value. We have already introduced the method of use in series (3), so we will not go into details here. 2. @CookieValue is used to bind the data in the cookie. Next, we use the sessionId in the cookie for testing: in DataBindContro.

2.SpringMVC Learning Series (4) Data Binding-1

Recommended articles about @PathVariable

Introduction: In series (3) we introduced how a request is mapped to an action. The next step is of course how to obtain the data in the request, which leads to what this article will talk about. Content - data binding. First, let’s take a look at the annotations for binding data: 1. @RequestParam, which binds a single request data, which can be the data in the URL, the data submitted by the form or the uploaded file; 2. @PathVariable , bind URL template variable value; 3. @CookieValue, bind cookie number

3.@RequestParam @RequestBody @PathVariable and other parameter binding annotations detailed explanation

Recommended articles about @PathVariable

Introduction: Introduction: Handler method parameter binding commonly used annotations, we divide them according to the different contents of the Request they handle. There are four categories: (mainly explaining common types) A. Annotations for processing the request uri part (here refers to the variable in the uri template, excluding the queryString part): @PathVariable; B. Annotations for processing the request header part: @RequestHeader

[Related Q&A recommendations]:

java - I would like to ask, can a default value be specified when @PathVariable is empty?

The above is the detailed content of Recommended articles about @PathVariable. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!