SPRINGMVC Learning Journey-First day: @RequestMapping

Source: Internet
Author: User

@RequestMapping: Request Mapping

SPRINGMVC No. 01 Day:

Defining controllers with @controller
Spring MVC distributes requests for specific URLs to the controller class for processing
In Spring 3.0, class is defined as a controller class by @controller annotations. In order for spring to find a bean defined as a controller, you need to add the following definition in the Spring-context configuration file: Scanner

1 <  base-package= "Net.zhepu.web"/>

1: What is @requestmapping?

Requestmapping: Request Mapping
Used to make modifiers, written before classes or methods, to modify methods and classes.
Function: Maps a request to a method, which is the binding of a foreground request to a target method. This method is the business logic that handles the current request.
notation: 1. Write before the method;
2. Write before the class;

2: Examples of@RequestMapping use:

3:@RequestMapping parameters in detail:

SPRINGMVC Learning Journey-First day: @RequestMapping

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.