如何在wicket中使用post方法 [英] How to use post method in wicket

查看:162
本文介绍了如何在wicket中使用post方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我想在我的页面中重定向到其他时我使用此方法异常:

when I want to redirect in my page to other I use this method exception:

    throw new RedirectToUrlException("/login/j_security_check?j_username=" + username + "&j_password=" + pass);

问题是此信息在浏览器中可见。我如何发送这个并使用POST方法?

problem is that this information are visible in browser. How I can send this and use POST method ?

推荐答案

对于大多数浏览器来说,POST重定向是一个有点深奥的边缘情况。 Wicket的RedirectRequestHandler目前仅支持HTTP代码301和302.POST重定向将需要307,这也将向用户显示警告。

POST redirects are a somewhat esoteric edge case with most browsers. Wicket's RedirectRequestHandler currently only supports HTTP codes 301 and 302. POST redirect would require 307, which will also show a warning to the user.

那就是说,你想要的是什么这本身就是不安全的。 是否曾将密码发回给客户。

That said, what you are trying to do is inherently unsafe. Do not ever send a password back to the client.

长话短说:Wicket不支持这个,你不应该无论如何这样做。

Long story short: Wicket doesn't support this, and you shouldn't be doing this anyway.

这篇关于如何在wicket中使用post方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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