GET提交而不是POST。挂毯 [英] GET submits instead of POST ones. Tapestry

查看:100
本文介绍了GET提交而不是POST。挂毯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


表单要求请求方法为POST,并且t:formdata
查询参数有值。

在访问日志中,我发现有时用不同的用户使用GET方法提交表单。尽管如此,根据文档,Tapestry 5使用post-redirect-get方案。此页面不允许匿名访问,因此它不能是机器人。所以我很沮丧可能是这个问题的原因。
建议请求。

在表单中有几个选择,由Ajax刷新。

编辑2.这样的GET请求来自用户而不是漫游器,因为从那个ips登录成功。

解决方案

这是一个古老的问题,但如果有人在搜索中绊倒了它......你可以装饰 Tapestry的RequestExceptionHandler来捕获这个异常并将用户重定向到他们可能需要的页面。



请参阅Tapestry特定错误常见问题代码以实现此操作:



https://tapestry.apache.org/specific -errors-faq.html


I've encountered this problem in tapestry 5.2 application:

Forms require that the request method be POST and that the t:formdata query parameter have values.

In access log, i found that sometimes there are form submits with GET method from different users. Though, according to docs, Tapestry 5 use post-redirect-get scheme. This page doesn't allow anonymous access, so it can't be robots. So i,m frustrated what can be the cause of such issue. Suggestions please.

There is couple of selects, refreshed by Ajax, on the form.

Edit 2. Such GET request came from users not bots, because there was successful logins from that ips.

解决方案

This is an old question, but in case anyone else stumbles upon it in a search... you can "decorate" Tapestry's RequestExceptionHandler to catch this exception and redirect the user to the page they probably wanted.

See the Tapestry Specific Errors FAQ for the code to implement this:

https://tapestry.apache.org/specific-errors-faq.html

这篇关于GET提交而不是POST。挂毯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆