在org.springframework.spring-web的jar包中在以下层级下:

org.springframework.web.bind.annotation;

//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
// package org.springframework.web.bind.annotation; import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.core.annotation.AliasFor; @Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@RequestMapping(
method = {RequestMethod.GET}
)
public @interface GetMapping {
@AliasFor(
annotation = RequestMapping.class
)
String name() default ""; @AliasFor(
annotation = RequestMapping.class
)
String[] value() default {}; @AliasFor(
annotation = RequestMapping.class
)
String[] path() default {}; @AliasFor(
annotation = RequestMapping.class
)
String[] params() default {}; @AliasFor(
annotation = RequestMapping.class
)
String[] headers() default {}; @AliasFor(
annotation = RequestMapping.class
)
String[] consumes() default {}; @AliasFor(
annotation = RequestMapping.class
)
String[] produces() default {};
}

 一些常见的MediaType

//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
// package org.springframework.http; import java.io.Serializable;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.util.InvalidMimeTypeException;
import org.springframework.util.MimeType;
import org.springframework.util.MimeTypeUtils;
import org.springframework.util.StringUtils;
import org.springframework.util.MimeType.SpecificityComparator; public class MediaType extends MimeType implements Serializable {
private static final long serialVersionUID = 2069937152339670231L;
public static final MediaType ALL = valueOf("*/*");
public static final String ALL_VALUE = "*/*";
public static final MediaType APPLICATION_ATOM_XML = valueOf("application/atom+xml");
public static final String APPLICATION_ATOM_XML_VALUE = "application/atom+xml";
public static final MediaType APPLICATION_FORM_URLENCODED = valueOf("application/x-www-form-urlencoded");
public static final String APPLICATION_FORM_URLENCODED_VALUE = "application/x-www-form-urlencoded";
public static final MediaType APPLICATION_JSON = valueOf("application/json");
public static final String APPLICATION_JSON_VALUE = "application/json";
public static final MediaType APPLICATION_JSON_UTF8 = valueOf("application/json;charset=UTF-8");
public static final String APPLICATION_JSON_UTF8_VALUE = "application/json;charset=UTF-8";
public static final MediaType APPLICATION_OCTET_STREAM = valueOf("application/octet-stream");
public static final String APPLICATION_OCTET_STREAM_VALUE = "application/octet-stream";
public static final MediaType APPLICATION_PDF = valueOf("application/pdf");
public static final String APPLICATION_PDF_VALUE = "application/pdf";
public static final MediaType APPLICATION_PROBLEM_JSON = valueOf("application/problem+json");
public static final String APPLICATION_PROBLEM_JSON_VALUE = "application/problem+json";
public static final MediaType APPLICATION_PROBLEM_JSON_UTF8 = valueOf("application/problem+json;charset=UTF-8");
public static final String APPLICATION_PROBLEM_JSON_UTF8_VALUE = "application/problem+json;charset=UTF-8";
public static final MediaType APPLICATION_PROBLEM_XML = valueOf("application/problem+xml");
public static final String APPLICATION_PROBLEM_XML_VALUE = "application/problem+xml";
public static final MediaType APPLICATION_RSS_XML = valueOf("application/rss+xml");
public static final String APPLICATION_RSS_XML_VALUE = "application/rss+xml";
public static final MediaType APPLICATION_STREAM_JSON = valueOf("application/stream+json");
public static final String APPLICATION_STREAM_JSON_VALUE = "application/stream+json";
public static final MediaType APPLICATION_XHTML_XML = valueOf("application/xhtml+xml");
public static final String APPLICATION_XHTML_XML_VALUE = "application/xhtml+xml";
public static final MediaType APPLICATION_XML = valueOf("application/xml");
public static final String APPLICATION_XML_VALUE = "application/xml";
public static final MediaType IMAGE_GIF = valueOf("image/gif");
public static final String IMAGE_GIF_VALUE = "image/gif";
public static final MediaType IMAGE_JPEG = valueOf("image/jpeg");
public static final String IMAGE_JPEG_VALUE = "image/jpeg";
public static final MediaType IMAGE_PNG = valueOf("image/png");
public static final String IMAGE_PNG_VALUE = "image/png";
public static final MediaType MULTIPART_FORM_DATA = valueOf("multipart/form-data");
public static final String MULTIPART_FORM_DATA_VALUE = "multipart/form-data";
public static final MediaType TEXT_EVENT_STREAM = valueOf("text/event-stream");
public static final String TEXT_EVENT_STREAM_VALUE = "text/event-stream";
public static final MediaType TEXT_HTML = valueOf("text/html");
public static final String TEXT_HTML_VALUE = "text/html";
public static final MediaType TEXT_MARKDOWN = valueOf("text/markdown");
public static final String TEXT_MARKDOWN_VALUE = "text/markdown";
public static final MediaType TEXT_PLAIN = valueOf("text/plain");
public static final String TEXT_PLAIN_VALUE = "text/plain";
public static final MediaType TEXT_XML = valueOf("text/xml");
public static final String TEXT_XML_VALUE = "text/xml";
private static final String PARAM_QUALITY_FACTOR = "q";
public static final Comparator<MediaType> QUALITY_VALUE_COMPARATOR = (mediaType1, mediaType2) -> {
double quality1 = mediaType1.getQualityValue();
double quality2 = mediaType2.getQualityValue();
int qualityComparison = Double.compare(quality2, quality1);
if (qualityComparison != 0) {
return qualityComparison;
} else if (mediaType1.isWildcardType() && !mediaType2.isWildcardType()) {
return 1;
} else if (mediaType2.isWildcardType() && !mediaType1.isWildcardType()) {
return -1;
} else if (!mediaType1.getType().equals(mediaType2.getType())) {
return 0;
} else if (mediaType1.isWildcardSubtype() && !mediaType2.isWildcardSubtype()) {
return 1;
} else if (mediaType2.isWildcardSubtype() && !mediaType1.isWildcardSubtype()) {
return -1;
} else if (!mediaType1.getSubtype().equals(mediaType2.getSubtype())) {
return 0;
} else {
int paramsSize1 = mediaType1.getParameters().size();
int paramsSize2 = mediaType2.getParameters().size();
return paramsSize2 < paramsSize1 ? -1 : (paramsSize2 == paramsSize1 ? 0 : 1);
}
};
public static final Comparator<MediaType> SPECIFICITY_COMPARATOR = new SpecificityComparator<MediaType>() {
protected int compareParameters(MediaType mediaType1, MediaType mediaType2) {
double quality1 = mediaType1.getQualityValue();
double quality2 = mediaType2.getQualityValue();
int qualityComparison = Double.compare(quality2, quality1);
return qualityComparison != 0 ? qualityComparison : super.compareParameters(mediaType1, mediaType2);
}
}; public MediaType(String type) {
super(type);
} public MediaType(String type, String subtype) {
super(type, subtype, Collections.emptyMap());
} public MediaType(String type, String subtype, Charset charset) {
super(type, subtype, charset);
} public MediaType(String type, String subtype, double qualityValue) {
this(type, subtype, Collections.singletonMap("q", Double.toString(qualityValue)));
} public MediaType(MediaType other, Charset charset) {
super(other, charset);
} public MediaType(MediaType other, @Nullable Map<String, String> parameters) {
super(other.getType(), other.getSubtype(), parameters);
} public MediaType(String type, String subtype, @Nullable Map<String, String> parameters) {
super(type, subtype, parameters);
} protected void checkParameters(String attribute, String value) {
super.checkParameters(attribute, value);
if ("q".equals(attribute)) {
value = this.unquote(value);
double d = Double.parseDouble(value);
Assert.isTrue(d >= 0.0D && d <= 1.0D, "Invalid quality value \"" + value + "\": should be between 0.0 and 1.0");
} } public double getQualityValue() {
String qualityFactory = this.getParameter("q");
return qualityFactory != null ? Double.parseDouble(this.unquote(qualityFactory)) : 1.0D;
} public boolean includes(@Nullable MediaType other) {
return super.includes(other);
} public boolean isCompatibleWith(@Nullable MediaType other) {
return super.isCompatibleWith(other);
} public MediaType copyQualityValue(MediaType mediaType) {
if (!mediaType.getParameters().containsKey("q")) {
return this;
} else {
Map<String, String> params = new LinkedHashMap(this.getParameters());
params.put("q", mediaType.getParameters().get("q"));
return new MediaType(this, params);
}
} public MediaType removeQualityValue() {
if (!this.getParameters().containsKey("q")) {
return this;
} else {
Map<String, String> params = new LinkedHashMap(this.getParameters());
params.remove("q");
return new MediaType(this, params);
}
} public static MediaType valueOf(String value) {
return parseMediaType(value);
} public static MediaType parseMediaType(String mediaType) {
MimeType type;
try {
type = MimeTypeUtils.parseMimeType(mediaType);
} catch (InvalidMimeTypeException var4) {
throw new InvalidMediaTypeException(var4);
} try {
return new MediaType(type.getType(), type.getSubtype(), type.getParameters());
} catch (IllegalArgumentException var3) {
throw new InvalidMediaTypeException(mediaType, var3.getMessage());
}
} public static List<MediaType> parseMediaTypes(@Nullable String mediaTypes) {
if (!StringUtils.hasLength(mediaTypes)) {
return Collections.emptyList();
} else {
String[] tokens = StringUtils.tokenizeToStringArray(mediaTypes, ",");
List<MediaType> result = new ArrayList(tokens.length);
String[] var3 = tokens;
int var4 = tokens.length; for(int var5 = 0; var5 < var4; ++var5) {
String token = var3[var5];
result.add(parseMediaType(token));
} return result;
}
} public static List<MediaType> parseMediaTypes(@Nullable List<String> mediaTypes) {
if (CollectionUtils.isEmpty(mediaTypes)) {
return Collections.emptyList();
} else if (mediaTypes.size() == 1) {
return parseMediaTypes((String)mediaTypes.get(0));
} else {
List<MediaType> result = new ArrayList(8);
Iterator var2 = mediaTypes.iterator(); while(var2.hasNext()) {
String mediaType = (String)var2.next();
result.addAll(parseMediaTypes(mediaType));
} return result;
}
} public static List<MediaType> asMediaTypes(List<MimeType> mimeTypes) {
return (List)mimeTypes.stream().map(MediaType::asMediaType).collect(Collectors.toList());
} public static MediaType asMediaType(MimeType mimeType) {
return mimeType instanceof MediaType ? (MediaType)mimeType : new MediaType(mimeType.getType(), mimeType.getSubtype(), mimeType.getParameters());
} public static String toString(Collection<MediaType> mediaTypes) {
return MimeTypeUtils.toString(mediaTypes);
} public static void sortBySpecificity(List<MediaType> mediaTypes) {
Assert.notNull(mediaTypes, "'mediaTypes' must not be null");
if (mediaTypes.size() > 1) {
mediaTypes.sort(SPECIFICITY_COMPARATOR);
} } public static void sortByQualityValue(List<MediaType> mediaTypes) {
Assert.notNull(mediaTypes, "'mediaTypes' must not be null");
if (mediaTypes.size() > 1) {
mediaTypes.sort(QUALITY_VALUE_COMPARATOR);
} } public static void sortBySpecificityAndQuality(List<MediaType> mediaTypes) {
Assert.notNull(mediaTypes, "'mediaTypes' must not be null");
if (mediaTypes.size() > 1) {
mediaTypes.sort(SPECIFICITY_COMPARATOR.thenComparing(QUALITY_VALUE_COMPARATOR));
} }
}

 

param 貌似都

RequestParam 

package org.springframework.web.bind.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.core.annotation.AliasFor; @Target({ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RequestParam {
@AliasFor("name")
String value() default ""; @AliasFor("value")
String name() default ""; boolean required() default true; String defaultValue() default "\n\t\t\n\t\t\n\ue000\ue001\ue002\n\t\t\t\t\n";
}

  

@RequestMapping中的注解的更多相关文章

  1. SpringBoot中常用注解@Controller/@RestController/@RequestMapping的区别

    @Controller 处理http请求 @Controller //@ResponseBody public class HelloController { @RequestMapping(valu ...

  2. SpringBoot 中常用注解@Controller/@RestController/@RequestMapping的区别

    SpringBoot中常用注解@Controller/@RestController/@RequestMapping的区别 @Controller 处理http请求 @Controller //@Re ...

  3. SpringBoot 中常用注解@Controller/@RestController/@RequestMapping介绍

    原文 SpringBoot 中常用注解 @Controller/@RestController/@RequestMapping介绍 @Controller 处理http请求 @Controller / ...

  4. spring注解开发中常用注解以及简单配置

    一.spring注解开发中常用注解以及简单配置 1.为什么要用注解开发:spring的核心是Ioc容器和Aop,对于传统的Ioc编程来说我们需要在spring的配置文件中邪大量的bean来向sprin ...

  5. Spring MVC 中采用注解方式 Action中跳转到另一个Action的写法

    Spring MVC 中采用注解方式 Action中跳转到另一个Action的写法 在Action中方法的返回值都是字符串行,一般情况是返回某个JSP,如: return "xx" ...

  6. SpringBoot 中常用注解

    本篇博文将介绍几种SpringBoot 中常用注解 其中,各注解的作用为: @PathVaribale 获取url中的数据 @RequestParam 获取请求参数的值 @GetMapping 组合注 ...

  7. SSM-SpringMVC-14:SpringMVC中大话注解式开发基础--呕心沥血版

     ------------吾亦无他,唯手熟尔,谦卑若愚,好学若饥------------- 注解的基础我不再多啰嗦,百度一搜很多,很详细啊,我就讲一下SpringMVC中的注解入门 通过注解的方式定义 ...

  8. SpringBoot 中常用注解@PathVaribale/@RequestParam/@GetMapping介绍

    SpringBoot 中常用注解@PathVaribale/@RequestParam/@GetMapping介绍 本篇博文将介绍几种如何处理url中的参数的注解@PathVaribale/@Requ ...

  9. Spring MVC 中 @ModelAttribute 注解的妙用

    Spring MVC 中 @ModelAttribute 注解的妙用 Spring MVC 提供的这种基于注释的编程模型,极大的简化了 web 应用的开发.其中 @Controller 和 @Rest ...

随机推荐

  1. 【LeetCode算法-28/35】Implement strStr()/Search Insert Position

    LeetCode第28题 Return the index of the first occurrence of needle in haystack, or -1 if needle is not ...

  2. 【LeetCode算法-21】Merge Two Sorted Lists

    LeetCode第21题 Merge two sorted linked lists and return it as a new list. The new list should be made ...

  3. PP篇11 增、改生产订单组件BAPI

    增.改生产订单组件BAPI BAPI_ALM_ORDER_MAINTAIN USE BAPI_ALM_ORDER_MAINTAIN TO CREATE OR CHANGE PM WORK ORDER ...

  4. java的单进程多线程模式

    java是单进程多线程模型,多线程依然可以充分利用多核(core)/多处理器(cpu) 单个cpu线程在同一时刻只能执行单一指令,也就是一个线程 单个线程同时只能在单个cpu线程中执行 Java中的所 ...

  5. 【C/C++开发】多线程编程中的join函数

    多线程编程中的join函数 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 # coding: utf-8 # 测试多线程中join的 ...

  6. Survey of single-target visual tracking methods based on online learning 翻译

    基于在线学习的单目标跟踪算法调研 摘要 视觉跟踪在计算机视觉和机器人学领域是一个流行和有挑战的话题.由于多种场景下出现的目标外貌和复杂环境变量的改变,先进的跟踪框架就有必要采用在线学习的原理.本论文简 ...

  7. android基础---->ListView的使用

    简单说明 ListView在android程序中比较常用,在此做一下简单的总结 内容:自定义ListView, 自定义Adapter,ListView滚动事件的应用! 项目结构如下图

  8. 01_Android入门

    Android系统文件目录结构 / 代表系统的根目录 /data/app/ 存放着第三方的apk文件 /system/app/ 其中是系统中的应用安装文件 /data/data/packagename ...

  9. 02 Struts2框架----学习笔记2(了解一下,已过时)

    1.*号通配符优化struts.xml代码 创建一个UserAction的动作类 package action; import com.opensymphony.xwork2.ActionSuppor ...

  10. Linux安装centos

    在虚拟机上安装centos 虚拟机使用win10自带的hyper-v非常好用 centos下载地址http://mirrors.aliyun.com/centos/7.6.1810/isos/x86_ ...