Springmvc-crud-06(路径忘记加上“/”错误)
错误:

原因:自己马虎忘记加" / ",罚继续写代码┭┮﹏┭┮
前端代码:
<h1>添加功能</h1>
<form action="test/1002/清秋/111" method="post">
<!--此处的POST尽量使用大写,小写可能不识别导致报错-->
<input type="hidden" name="_method" value="POST">
<input type="submit" value="这是测试添加功能">
</form>
后台代码:

修改后的代码:
@RequestMapping(value="/test/{id}/{username}/{password}",method=RequestMethod.POST)
public String testPost(@PathVariable("id")int id,@PathVariable("username")String username,@PathVariable("password")String password){
System.out.println("这是添加功能");
System.out.println(id+" "+username+" "+password);
return "redirect:/test";
}
Springmvc-crud-06(路径忘记加上“/”错误)的更多相关文章
- SpringMVC 给请求路径加上统一前缀
最开始想到的是通过硬编码的方式手动在每个路径上加上前缀, 后面发现这种方式太不智能了,万一要修改那还不得改死, Spring既然支持EL表达式, 那能不能通过EL表达式的方式去读取配置文件里面的属性来 ...
- SpringMVC form:form的一个错误(没有传到前台绑定类)
SpringMVC form:form的一个错误(没有传到前台绑定类) 报错信息: Neither BindingResult nor plain target object for bean nam ...
- SpringMVC中映射路径的用法之请求限制、命名空间
SpringMVC中映射路径的请求限制 什么是SpringMVC请求限制? 在SpringMVC中,支持对请求的设置.如果不满足限制条件的话,就不让请求访问执行方法,这样可以大大提高执行方法 的安全性 ...
- CSS样式表、JS脚本加载顺序与SpringMVC在URL路径中传参数与SpringMVC 拦截器
CSS样式表和JS脚本加载顺序 Css样式表文件要在<head>中先加载,这样网页显示时可以第一次就渲染出正确的布局和样式,网页就不会闪烁,或跳变 JS脚本尽可能放在<body> ...
- SpringMVC的AJAX请求报406错误
SpringMVC的AJAX请求报406错误原因有两种:1.jackson包没有引入 2.如果已经引入jackson包了还报406的错误,那么就有可能是请求的url路径是.html结尾,但是返回的数据 ...
- springMVC访问根路径问题
当web.xml没有配置欢迎页:如下 <welcome-file-list> <welcome-file>login.jsp</welcome-file> < ...
- SpringMVC中出现" 400 Bad Request "错误(用@ResponseBody处理ajax传过来的json数据转成bean)的解决方法
最近angularjs post到后台 400一头雾水 没有任何错误. 最后发现好文,感谢作者 SpringMVC中出现" 400 Bad Request "错误(用@Respon ...
- 解决ajax请求(SpringMVC后台)响应415/400/405错误
解决ajax请求(SpringMVC后台)响应415/400/405错误 后端代码 bean public class user { private String username; private ...
- 使用springmvc时报错org.springframework.beans.NullValueInNestedPathException: Invalid property 'department' of bean class [com.atguigu.springmvc.crud.entities.Employee]:
使用springmvc时报错 org.springframework.beans.NullValueInNestedPathException: Invalid property 'departmen ...
随机推荐
- bootstrap资料索引
中文手册 : http://w3c.3306.biz/bootstrap_forms/show-25-64-1.html
- 题解 【洛谷P1115】最大子段和
这是一道枚举经典题. 本题有三种做法,各位需要根据每个题的数据范围来决定自己用哪种方法. 本题解中统一设最大和为Max. 方法一. 枚举子序列,从起点到终点求和.时间复杂度:O(n^3) 我们可以枚举 ...
- [一本通学习笔记] RMQ专题
傻傻地敲了好多遍ST表. 10119. 「一本通 4.2 例 1」数列区间最大值 #include <bits/stdc++.h> using namespace std; const i ...
- PP:Classification of Time-Series Images Using Deep Convolutional Neural Networks
The 10th international conference on machine vision; C类 Methodology: 非主流方法 2 stages: 1. convert time ...
- How to Create an OCM Response file to Apply a Patch in Silent Mode - opatch silent
Windows Server 2019 打补丁时缺少Oracle Configuration Manager(OCM) 响应文件处理方式. 适用: Oracle Universal Installer ...
- HTTP响应头 状态码
HTTP 简介 HTTP协议是Hyper Text Transfer Protocol(超文本传输协议)的缩写,是用于从万维网(WWW:World Wide Web )服务器传输超文本到本地浏览器的传 ...
- Whctf 2017 -UNTITLED- Writeup
Whctf 2017 -UNTITLED- Writeup 转载请表明出处http://www.cnblogs.com/WangAoBo/p/7541481.html 分析: 下载下来的附件是一个py ...
- codeforces 1288D. Minimax Problem(二分)
链接:https://codeforces.com/contest/1288/problem/D D. Minimax Problem 题意:给定n个数组,长度为m,从n中数组挑选两个数组,两个数组中 ...
- windows系统 安装 mysql.fx
windows系统 安装 mqtt.fx 软件官网:http://mqttfx.jfx4ee.org/ 软件下载:http://www.jensd.de/apps/mqttfx/1.1.0/
- html滑动
$('html, body').animate({scrollTop: 1500}, 'fast');