zoukankan      html  css  js  c++  java
  • SpringMVC注解@RequestMapping全面解析

    @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

  • 相关阅读:
    vijos1746 floyd
    总结
    用javascript代码拼html
    异步编程学习
    SELECT
    设计 Azure SQL 数据库,并使用 C# 和 ADO.NET 进行连接
    H2数据库
    ASP.NET 文档
    ASP.NET MVC
    ASP.NET Core 中的 Razor 页面介绍
  • 原文地址:https://www.cnblogs.com/wanghongye/p/5506254.html
Copyright © 2011-2022 走看看