@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. MySQL常用命令符

    收集于网络!!!! 解决字符乱码问题:显示汉语而非乱码:set names utf8: 修改新密码:update user set password=PASSWORD('新密码') where use ...

  2. Vue.js ---Hello---1

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  3. ASPxDashboardViewer_OnDashboardLoaded 修改Item参数

    protected void ASPxDashboardViewer_OnDashboardLoaded(object sender, DashboardLoadedWebEventArgs e) { ...

  4. 升级openssh编译报错“configure: error: *** working libcrypto not found, check config.log”的解决办法

    问题描述 在linux上,欲将OpenSSH_6.4p1编译升级到OpenSSH_8.0p1时,执行了./configure --prefix=/usr --sysconfdir=/etc/ssh - ...

  5. 托管代码中调用c++本地代码

    c++本地动态连接库代码 #pragma once #include "stdafx.h" #ifdef PERSON_EXPORTS #define PERSON_API __d ...

  6. 本地cmd连接远程mysql数据库

    一.登录远程mysql 输入mysql -h要远程的IP地址 -u设置的MySQL用户名 -p登录用户密码 例如:mysql -h 192.168.1.139 -u root -p dorlocald ...

  7. 第三十七篇 入门机器学习——Numpy基础

    No.1. 查看numpy版本 No.2. 为了方便使用numpy,在导入时顺便起个别名 No.3. numpy.array的基本操作:创建.查询.修改 No.4. 用dtype查看当前元素的数据类型 ...

  8. mongo gridfs 学习

    一.mongo是啥东西? MongoDB 是由C++语言编写的,基于分布式文件存储的开源数据库系统.在高负载的情况下,添加更多的节点,可以保证服务器性能. 二.gridfs是啥东西? 1.MongoD ...

  9. 为什么html表单用post提交后,提交页面是空白

    为什么html表单用post提交后,提交页面是空白? 因为post提交就应该用doPost()方法处理数据

  10. 数据存储 csv

    # # 保存csv格式的数据import csv csvFile = open('test.csv','w+',newline='') #文本方式可读写 try: writer = csv.write ...