English 中文(简体)
考虑到在使用Ajax时使用MVC
原标题:Considering authentication when using Ajax with Spring MVC

I am trying to use ajax in my spring mvc application. When I try a url (post/get) which is secured and needs authentication, the response is the html of login page as it is redirected behind the scenes. What is the best approach to overcome this issue?

问题回答

首先,如果用户无法认证,我将避免显示Ajax与需要认证的URLs的联系。

如果不是始终可能的话,可以将您的日志重新贴上特别的吉大港山区应急反应法(或以任何其他方式将其与正常反应区分开来),如果收到这一反应法,则您的 Java本呼可取代目前网页的整整整整整页。 多数美加澳新军图书馆都设法确定一名助手,满足阿加新军的所有要求。 这里可以使用这种全球手稿。

日志网页还可以根据AJAX的请求仅归还地位法,如果收到这一地位法,那么 Java文法将转至日志(没有使用AJAX)。

我可能没有很好地解释这一问题。 因此,我没有得到正确的回应。 然而,JB Nizet的答复含有其他一些要点。 因此,感谢你。

I could solve the issue after coming back to this issue after some time, so I posted about this on my blog.

我希望这是有益的。





相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Remotely authenticating client Windows user on demand

Suppose I am writing a server for a particular network protocol. If I know that the client is running on a Windows machine, is it possible for my server to authenticate the Windows user that owns the ...

Role/Permission based forms authorizing/authentication?

While looking into forms authorizing/authentication, I found that it is possible to do role based authorizing by adding an array of roles to a FormsAuthenticationTicket. That way I can write User....

热门标签