method:

@Controller

@RequestMapping("/test")

public String MyController{

@RequestMapping("/begin")

public String hi(HttpServletRequest request){

String name=request.getParameter("name");

System.out.println(name);

return "MyJsp";

url:"http://asus5-pc:8080/springMvc/test/begin?=zhan"

控制台输出:

zhan

restful风格:

method:

@Controller

@RequestMapping("/test")

public String MyController{

@RequestMapping("/begin/{name}")

public String hi(@PathVariable("name") String name){

System.out.println(name);

return "MyJsp";

url:"http://asus5-pc:8080/springMvc/test/begin/zhan.do"

控制台输出:

zhan

springMvc框架之Restful风格的更多相关文章

  1. SpringMvc笔记-对RESTFUL风格的配置

    1.@RequestMapping注解可以使用如下参数: 1,params:例如params={'username',"age!=100"}表示需要usernmame并且age 属 ...

  2. springMVC中添加restful 风格

    RESTful架构:是一种设计的风格,并不是标准,只是提供了一组设计原则和约束条件,也是目前比较流行的一种互联网软件架构.它结构清晰.符合标准.易于理解.扩展方便,所以正得到越来越多网站的采用. 关于 ...

  3. django框架实现restful风格的API开发

    RESTful风格的要求:https://www.cnblogs.com/chichung/p/9933116.html 利用django原生的框架直接做RESTful的API开发是怎样的呢?感受一下 ...

  4. springMVC+json构建restful风格的服务

    首先.要知道什么是rest服务,什么是rest服务呢? REST(英文:Representational State Transfer,简称REST)描写叙述了一个架构样式的网络系统.比方 web 应 ...

  5. springmvc+swagger构建Restful风格文档

    本次和大家分享的是java方面的springmvc来构建的webapi接口+swagger文档:上篇文章分享.net的webapi用swagger来构建文档,因为有朋友问了为啥.net有docpage ...

  6. SpringMVC框架04——RESTful入门

    1.RESTful的基本概念 REST(Representational State Transfer)表述性状态转移,REST并不是一种创新技术,它指的是一组架构约束条件和原则,符合REST的约束条 ...

  7. springmvc中配置RESTful风格控制器

    一般的http请求中其实只需要get和post就可以满足项目需求了,而为什么还要使用restful可能就是为了使请求url看起来更加直观,好看吧.. restful常用的请求方式:get,post,p ...

  8. SpringMVC框架——集成RESTful架构

    REST:Representational State Transfer 资源表现层状态转换 Resources 资源 Representation 资源表现层 State Transfer 状态转换 ...

  9. springmvc复习笔记----Restful 风格,PathVariable获取 Url实例

    结构 包与之前相同 <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi=&qu ...

随机推荐

  1. 免费开源的获取代理ip项目

    地址:https://github.com/awolfly9/IPProxyTool 根据教程获取ip,项目使用Python语言写的,正好可以让前些日子学了点Python皮毛的我长长见识: ip都是会 ...

  2. iView的表单table

    // html<div class="exam-list"> <Table :columns="columns7" :data="d ...

  3. pytest---参数化

    import pytest @pytest.mark.parametrize('test_input,expected',[('3+5',8), ('2-1',1),('7*5',30)])def t ...

  4. LeetCode Array Easy121. Best Time to Buy and Sell Stock

    Description Say you have an array for which the ith element is the price of a given stock on day i. ...

  5. Mac下homebrew的安装与卸载

    mac系统常用的软件安装工具就是homebrew 个人认为通过brew安装比较简单,下面介绍下如何安装 安装和卸载homebrew 安装 /usr/bin/ruby -e "$(curl - ...

  6. Keepalived高可用服务

    Keepalived高可用服务 避免负载均衡服务出现单点问题 高可用服务原理 Keepalived的工作原理: Keepalived高可用对之间是通过VRRP通信的,因此,我从 VRRP开始了解起: ...

  7. mysql数据库用户权限设置

    设置用户权限:格式:grant 权限列表 on 数据库名.表名 to '用户名'@'来源地址' identified by '密码'; * 权限列表:用于列出授权的各种数据库操作,通过逗号进行分割,如 ...

  8. ECMAScript6 Promise

    Promise在Javascript中早就已经实现,在ECMAScript6中正式加入到标准.那么Promise到底是干什么的?怎么用? 一.Promise介绍 Promise是一个对象,用来传递异步 ...

  9. 分布式消息中间件(二)ActiveMQ

    一.概述 Apache出品,最流行的,能力强劲的开源消息总线. 1.JMS规范 Java消息服务(Java Message Service,即JMS)应用程序接口是一个Java平台中关于面向消息中间件 ...

  10. 【leetcode】970. Powerful Integers

    题目如下: Given two non-negative integers x and y, an integer is powerful if it is equal to x^i + y^j fo ...