@RequestMapping 可以出现在类级别上,也可以出现在方法上。如果出现在类级别上,那请求的 url 为 类级别上的@RequestMapping + 方法级别上的 @RequestMapping,否则直接取方法级上的 @RequestMapping。 类级别的@RequestMapping 不是必需的。

http://zachary-guo.iteye.com/blog/1318597

1

@PathVariable可以携带多个参数
@RequestMapping("/publication/{publicationType}/{specifyPublisherId}/{specifyPublisherType}/{isPar}")
public void queryPublicationList(@PathVariable String publicationType, @PathVariable String specifyPublisherId,
@PathVariable String specifyPublisherType,@PathVariable Boolean isPar, HttpServletRequest request, HttpServletResponse response) {

2

    @RequestMapping(value="/revocation",method=RequestMethod.POST)
@ResponseBody
public Object revocation(@RequestParam(required=true)String publicationType,
@RequestParam(required=true)Long id,
@RequestParam(required=true)Byte codeType,
@RequestParam(required=true)String revDesc,HttpServletRequest request){

3

SpringMVC注解@RequestMapping全面解析的更多相关文章

  1. SpringMVC注解@RequestMapping全面解析---打酱油的日子

    @RequestMapping 可以出现在类级别上,也可以出现在方法上.如果出现在类级别上,那请求的 url 为 类级别上的@RequestMapping + 方法级别上的 @RequestMappi ...

  2. SpringMVC注解@RequestMapping之produces属性导致的406错误

    废话不多说,各位,直接看图说话,敢吗?这个问题网上解决的办法写的狠是粗糙,甚至说这次我干掉它完全是靠巧合,但是也不否认网上针对406错误给出的解决方式,可能是多种情况下出现的406吧?我这次的流程就是 ...

  3. SpringMVC注解@RequestMapping @RequestParam @ResponseBody 和 @RequestBody 解析

    SpringMVC Controller层获取参数及返回数据的方式: @RequestMapping @RequestMapping(“url”),这里的 url写的是请求路径的一部分,一般作用在 C ...

  4. springmvc中RequestMapping的解析

    在研究源码的时候,我们应该从最高层来看,所以我们先看这个接口的定义: package org.springframework.web.servlet; import javax.servlet.htt ...

  5. SpringMVC注解@RequestParam全面解析---打酱油的日子

    在SpringMVC后台控制层获取参数的方式主要有两种,一种是request.getParameter("name"),另外一种是用注解@RequestParam直接获取.这里主要 ...

  6. SpringMVC注解@RequestParam全面解析

    在SpringMVC后台控制层获取参数的方式主要有两种,一种是request.getParameter("name"),另外一种是用注解@RequestParam直接获取.这里主要 ...

  7. Ajax Post提交事例及SpringMVC注解@RequestMapping取不到参数值解决办法

    var xmlHttp; //定义变量,用来创建xmlHttp对象 function ajaxfunction(url,onreadystatechangMethod,param){ // 创建xml ...

  8. SpringMVC注解@RequestMapping

        /**      * GET 查询      *      * @return 视图路径      */     @RequestMapping(value = {"/index&q ...

  9. SpringMVC 源码深度解析<context:component-scan>(扫描和注冊的注解Bean)

    我们在SpringMVC开发项目中,有的用注解和XML配置Bean,这两种都各有自己的优势,数据源配置比較经经常使用XML配置.控制层依赖的service比較经经常使用注解等(在部署时比較不会改变的) ...

随机推荐

  1. Python入门7 —— 赋值运算符补充

    增量赋值 x = 10 x += 1 #就是:x = x+1 交叉赋值 a = 10 b = 20 print(a,b) temp=b # temp=20 b=a # b = 10 a=temp # ...

  2. 【算法】状态压缩DP

    状态压缩DP是什么? 答:利用位运算(位运算比加减乘除都快!)来记录状态,并实现动态规划. 适用于什么问题? 答:数据规模较小:不能使用简单的算法解决. 例题: 题目描述 糖果店的老板一共有M 种口味 ...

  3. pytest学习1-安装和入门

    一.安装pytest: 在命令行窗口下执行: pip install -U pytest 检查安装的pytest版本: pytest -v 二.运行第一个测试用例: import pytest def ...

  4. jQuery尺寸

    jQuery 尺寸 jQuery width() 和 height() 方法 width() 方法设置或返回元素的宽度(不包括内边距.边框或外边距). height() 方法设置或返回元素的高度(不包 ...

  5. 【转载】Pig语法进阶

    转自:http://www.cnblogs.com/siwei1988/archive/2012/08/06/2624912.html Pig Latin是一种数据流语言,变量的命名规则同java中变 ...

  6. 第五篇,理解JS模块化编程思想

    模块化编程 ·模块化编程是一种处理复杂系统分解成更好的可管理模块的方式,它可以把系统代码划分为职责单一高度解耦切可替代的模块. ·系统中某一部分的变化将如何影响其他部分就会变得显而易见,系统的可维护性 ...

  7. Python - python3.7新增的contextvars vs Thread local(threading.local)

    总结 和threading.local()类似.Python3.7新增. thread.local(): 不同线程,同一个变量保存不同的值. contextvars: 不同上下文,同一个变量保存不同的 ...

  8. C++-hihoCode-1105/1109-[STL][堆][prime]

    #include <set> #include <map> #include <cmath> #include <queue> #include < ...

  9. codeforces Codeforces Round #597 (Div. 2) B. Restricted RPS 暴力模拟

    #include <bits/stdc++.h> using namespace std; typedef long long ll; ]; ]; int main() { int t; ...

  10. 用fgets()和fputs()代替gets()和puts()

    gets()和puts不安全,有些平台会报错,如pat. gets输入字符串时,不进行数组下标的检查,也就是说当你的数组长度是n时,输入超过该长度的字符串的时候,编译不会出错,但是运行的时候会出现数组 ...