GET方法不支持。我出错的原因在于,在JSP中我希望超链接a以post方式提交,但是这里写js代码时出错。

<script type="text/javascript">
$(function(){
$(".delete").click(function(){
var href = $(this).attr("href");
$("form").attr("action",href).submit();
//alert("ok");
return false;
})
})
</script>

js代码本身并没有错,错误的是超链接的配置。

    <form action="" method="post">
<input type="hidden" name="_method" value="delete" />
</form> <a href="emp/${emp.id }">Delete</a>

上面是jsp代码,超链接a少了一个class="delete"

下面这样改就对了。

 <form action="" method="post">
<input type="hidden" name="_method" value="delete" />
</form> <a class="delete" href="emp/${emp.id }">Delete</a>

使用SpringMVC时报错HTTP Status 405 - Request method 'GET' not supported的更多相关文章

  1. Restful风格,PUT修改功能请求,表单中存在文件报错-HTTP Status 405 - Request method 'POST' not supported

    解决方案配置如下 <!-- 配置文件上传解析器 --> <bean id="multipartResolver" class="org.springfr ...

  2. There was an unexpected error (type=Method Not Allowed, status=405). Request method 'POST' not supported

    背景:点击提交按钮ajax请求接口时,报出错误[ Whitelabel Error Page This application has no explicit mapping for /error, ...

  3. HTTP Status 405 - Request method 'GET' not supported?(尚硅谷Restful案例练习关于Delete方法出现的错误)

    哈罗大家好,最近在如火如荼的学习java开发----Spring系列框架,当学习到SpringMVC,动手实践RESTFUL案例时,发现了以上报错405,get请求方法没有被支持. 首先第一步,我查看 ...

  4. springMVC出现HTTP Status 405 - Request method 'GET' not supported错误的解决方法

    今天在写一个简单的springMVC的表单请求处理时,出现了这个问题.我的form表单用的是post方法提交,并没有使用get方法,出现这个问题时,笔者可谓是一脸懵逼. 这是form表单: 这是对po ...

  5. SpringMVC框架出现 405 request method post not supported 的解决方法

    在SpringMVC框架中当使用post请求服务,然后请求成功转到一个静态文件,如html,htm等网页时.页面出现405 request method post not supported错误,只要 ...

  6. Spring MVC出现POST 400 Bad Request &405 Request method 'GET' not supported

    首先描述一下出现错误的情景: 我刚学springmvc,想做一个登录界面的东西.然后试着写了一个controller如下: @RequestMapping(value = "/login&q ...

  7. tomcat报错HTTP Status 405 - HTTP method GET is not supported by this URL

    servlet提交表单,结果出错. 出现HTTP Status 405 - HTTP method GET is not supported by this URL 原因是:1.继承自Httpserv ...

  8. 使用springmvc时报错HTTP Status 400 -

    这个错误大多是因为,jsp的form表单提交的字段类型和后台接收字段类型不匹配造成的(例如,form中为String,后台接收为Integer). 我这里就是jsp表单中的日期数据没有写明类型,然后用 ...

  9. WARN PageNotFound:208 - Request method 'POST' not supported

    在地址栏输入网址访问页面 ,用的是GET方法. 在用ajax接收后台数据,根据返回值进行提示或页面跳转时报:WARN PageNotFound:208 - Request method 'POST' ...

随机推荐

  1. delphi =------报错

    关于delphi软件运行出现Invalid floating point operation的错误的解决办法 关于delphi软件运行出现Invalid floating point operatio ...

  2. Spoken English Practice(I'm gonna do something I never thought I'd be able to)

    绿色:连读:                  红色:略读:               蓝色:浊化:               橙色:弱读     下划线_为浊化 口语蜕变(2017/7/6) 英 ...

  3. 获取文档版本版本值 滚动标识符 游标 控制查询如何执行 控制查询在哪些分片执行 boost加权

    映射mapping.json{ "book": { "_index": { "enabled": true }, "_id&quo ...

  4. centos7在vmware上无法上网

    centos7在虚拟机中设置NAT后也无法上网! 首先激活网卡!打开桌面右键在终端中打开:cd /etc/sysconfig/network-scripts/ls 找到以ifcfg开头的,如ifcfg ...

  5. 8.Query Documents-官方文档摘录

    总结 1 先插入数据 db.inventory.insertMany([ { item: "journal", qty: 25, size: { h: 14, w: 21, uom ...

  6. Redis配置文件的使用

    Redis基本配置 常规配置 进到配置文件下 vi /etc/redis.conf 写入配置项 port 1111 # 配置端口号 daemonize yes # 是否后台运行 daemonize y ...

  7. 对 tensorflow 中 tf.nn.embedding_lookup 函数的解释

    http://stackoverflow.com/questions/34870614/what-does-tf-nn-embedding-lookup-function-do embedding_l ...

  8. 关于java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log

    配置JFinal环境时,jar包已导入,web.xml已配置,Config也已经配置好,测试服务器时不停地出现 Exception in thread "main" java.la ...

  9. Oracle SQL 外键测试

    测试SQL 创建SQL     t1为主表      t2为子表 create table t1(insert_date number,id int) create table t2(insert_d ...

  10. appium的初始化准备工作

    文章出处http://blog.csdn.net/jiuzuidongpo/article/details/51790455 Appium在接收到客户端脚本的连接之后的初始化准备工作列表(细节部分详细 ...