GWT-Spring Security-会话超时
我有一个 GWT + Spring Security Web 应用程序。我试图添加:
<security:session-management invalid-session-url="/X.html"/>
但是,当我尝试测试这一点时。看来我看到了一个:
com.google.gwt.user.client.rpc.InvocationException
消息作为X.html的HTML内容。有人可以建议如何解决这个问题吗?
I have a GWT + Spring Security web app. I was trying to add:
<security:session-management invalid-session-url="/X.html"/>
However, when I try to test this. It seems I see a:
com.google.gwt.user.client.rpc.InvocationException
with message as the HTML content of X.html. Can someone please advise on how to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于 GWT 通过 Ajax RPC 请求与服务器通信,因此浏览器不会重定向到
X.html
。您在服务调用中需要做的是,如果未经授权,则抛出异常,并在AsyncCallback
的void onFailure(Throwable catch)
方法中进行处理。Because GWT communicates with a server via Ajax RPC requests, the browser will not be redirected to
X.html
. What you need to do in your service calls is throw an exception if they are not authorized and handle in invoid onFailure(Throwable caught)
method of yourAsyncCallback
.如果您想重定向到 /X.html ,请尝试:
但是,如果您想将请求发送到服务器,请使用 RequestBuilder:
If you want to redirect to /X.html try:
However, if you want to send the request to the server use RequestBuilder: